Added top down (using module name) resolution to the grand resolver
parent
ab5ee58055
commit
c5f45e6a36
|
@ -23,6 +23,11 @@ public final class TypeChecker
|
||||||
/* The name resolver */
|
/* The name resolver */
|
||||||
private Resolver resolver;
|
private Resolver resolver;
|
||||||
|
|
||||||
|
public Module getModule()
|
||||||
|
{
|
||||||
|
return modulle;
|
||||||
|
}
|
||||||
|
|
||||||
this(Module modulle)
|
this(Module modulle)
|
||||||
{
|
{
|
||||||
this.modulle = modulle;
|
this.modulle = modulle;
|
||||||
|
|
|
@ -93,6 +93,8 @@ public final class Resolver
|
||||||
* If no dot
|
* If no dot
|
||||||
*
|
*
|
||||||
* Try and find `name` within c
|
* Try and find `name` within c
|
||||||
|
*
|
||||||
|
* TODO: WOn't resolve a module
|
||||||
*/
|
*/
|
||||||
if(path.length == 1)
|
if(path.length == 1)
|
||||||
{
|
{
|
||||||
|
@ -154,6 +156,19 @@ public final class Resolver
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* TODO: Bug is we will never find top container */
|
/* TODO: Bug is we will never find top container */
|
||||||
|
/* Check if the name of root is that of Module */
|
||||||
|
if(cmp(typeChecker.getModule().getName(), path[0]) == 0)
|
||||||
|
{
|
||||||
|
/* Root ourselves relative to the Module */
|
||||||
|
/* TODO: Don't serch for myModule class and ooga within */
|
||||||
|
/**
|
||||||
|
* TODO: Although the above should be impossible when we set usable names
|
||||||
|
* and make sure module name cannot be sed anywhere
|
||||||
|
*/
|
||||||
|
/* TODO: Even if it could be because of this check it would be ignored */
|
||||||
|
/* TODO: This is what we want, but to avoid confusion we shouldn't allow the use of that name */
|
||||||
|
return resolveBest(typeChecker.getModule(), name);
|
||||||
|
}
|
||||||
|
|
||||||
Entity entityFound = resolveUp(c, path[0]);
|
Entity entityFound = resolveUp(c, path[0]);
|
||||||
|
|
||||||
|
|
|
@ -39,13 +39,7 @@ class X : myModule.ooga
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class myModule
|
|
||||||
{
|
|
||||||
class ooga
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class K : myModule.ooga
|
class K : myModule.ooga
|
||||||
{
|
{
|
||||||
|
@ -54,7 +48,10 @@ class X : myModule.ooga
|
||||||
|
|
||||||
class D : X.Y
|
class D : X.Y
|
||||||
{
|
{
|
||||||
|
class Fok : myModule.ooga
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class F : Shekshi.G.F {}
|
class F : Shekshi.G.F {}
|
||||||
|
@ -148,6 +145,16 @@ class Them
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class naai : testClass.test3.llllll.fokfok
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class baai : myModule.testClass.test3.llllll.fokfok
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue