Added documentation explaining how `checkContainer(Container)` works

parser_exception_before
Tristan B. V. Kildaire 2021-04-01 15:30:02 +02:00
parent 8567d8baeb
commit 5c9fd0a229
2 changed files with 24 additions and 5 deletions

View File

@ -284,10 +284,28 @@ public final class TypeChecker
/** /**
* Given a Container c and Type to search for * Given a Container `c` this will check all
* this makes sure that within the container * members of said Container and make sure
* there are no entities with duplicate names * none of them have a name that conflicts
* or sharing the same name as the Container * with any other member in said Container
* nor uses the same name AS the Container
* itself.
*
* Errors are printed when a member has a name
* of a previously defined member
*
* Errors are printed if the memeber shares a
* name with the container
*
* If the above 2 are false then a last check
* happens to check if the current Entity
* that just passed these checks is itself a
* Container, if not, then we do nothing and
* go onto processing the next Entity that is
* a member of Container `c` (we stay at the
* same level), HOWEVER if so, we then recursively
* call `checkContainer` on said Entity and the
* logic above applies again
*/ */
private void checkContainer(Container c) private void checkContainer(Container c)
{ {

View File

@ -9,6 +9,7 @@ int b = a;
int c = myModule.x; int c = myModule.x;
int l; int l;
int o = myModule.l; int o = myModule.l;