WIP: Module-level type checking

This commit is contained in:
Tristan B. Kildaire 2021-06-06 18:13:12 +02:00
parent bffcaa0898
commit 8e2807c24a
1 changed files with 52 additions and 0 deletions

View File

@ -2,7 +2,9 @@ module compiler.typecheck.dependancy;
import gogga;
import compiler.symbols.data;
import compiler.symbols.typing.core;
import compiler.typecheck.core;
import std.conv : to;
/**
@ -46,5 +48,55 @@ public void dependancyGenerate(TypeChecker tc, Container container)
/**
* Process all entities
*
* The natural order would be classes, funcitons/variables (I cannot remember TOOD: check this)
*/
foreach(Entity entity; containerEntities)
{
/**
* If we are at Module level then things differ
* ever so slightly
*/
if(container == tc.getModule())
{
/**
* If it is a variable
*/
if(cast(Variable)entity)
{
Variable variable = cast(Variable)entity;
/* Get the variable's type */
Type variableType = tc.getType(container, variable.getType());
/* If then variable has an assignment */
if(variable.getAssignment())
{
/* TODO: Add assignment support */
}
}
}
/**
* If we are at the Class level
*/
else if(cast(Clazz)container)
{
}
/**
* If we are at the Struct level
*/
else if(cast(Struct)container)
{
}
/**
* Any other type of Container
*/
else
{
/* This shouldn't happen */
assert(false);
}
}
}