- Added more methods to the method table for `Resolver`
This commit is contained in:
Tristan B. Velloza Kildaire 2023-08-20 17:01:47 +02:00
parent 7c11f674a3
commit 2b31ca374d
2 changed files with 21 additions and 5 deletions

View File

@ -32,8 +32,12 @@ use this to do its resolution.
Before we get into how it all works lets first see the API offered to
us by the resolver (in `source/`):
| Method name | Return type | Description |
|--------------------------------------------|-------------|---------------------------------------------------------------------------------------|
| `generateNameBest( Entity)` | `string` | Given an `Entity` this will return the absolute path to it |
| `generateName( Container, Entity)` | `string` | Returns the path of the `Entity` relative to the `Container` |
| `isDescendant( Container, Entity)` | `bool` | Checks if the given `Entity` can be found *somewhere* within the provided `Container` |
| Method name | Return type | Description |
|-----------------------------------------------------------|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `generateNameBest( Entity)` | `string` | Given an `Entity` this will return the absolute path to it |
| `generateName( Container, Entity)` | `string` | Returns the path of the `Entity` relative to the `Container` |
| `isDescendant( Container, Entity)` | `bool` | Checks if the given `Entity` can be found *somewhere* within the provided `Container` |
| `resolveWithin( Container, string)` | `Entity` | Looksup an `Entity` with the given name from within the provided `Container` |
| `resolveUp( Container, string)` | `Entity` | Looksup an `Entity` with the name provided, starting from the `Container` given but it may resolve upwards past it if it isnt found within it |
| `resolveBest( Container, string)` | `Entity` | Comibines the above two to allow resolving downwards and upwards in case not found when going downwards |
| `findContainerOfType( TypeInfo_Class, Statement)` | `Container` | Given a type-of `Container` and a `Statement` this will try find a container that the provided statement apears in by traversing upwards through any nested containers and stopping at the one which **exactly** matches the given type |

View File

@ -24,3 +24,15 @@ Before we get into how it all works let's first see the API offered to us by the
| `isDescendant(
Container,
Entity)` | `bool` | Checks if the given `Entity` can be found _somewhere_ within the provided `Container` |
| `resolveWithin(
Container,
string)` | `Entity` | Looksup an `Entity` with the given name from within the provided `Container` |
| `resolveUp(
Container,
string)` | `Entity` | Looksup an `Entity` with the name provided, starting from the `Container` given but it may resolve upwards past it if it isn't found within it |
| `resolveBest(
Container,
string)` | `Entity` | Comibines the above two to allow resolving downwards and upwards in case not found when going downwards |
| `findContainerOfType(
TypeInfo_Class,
Statement)` | `Container` | Given a type-of `Container` and a `Statement` this will try find a container that the provided statement apears in by traversing upwards through any nested containers and stopping at the one which **exactly** matches the given type |