Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿงน๏ธ๐Ÿงผ Cleanup: Pool provider #33

Merged
merged 30 commits into from
Feb 27, 2024

Conversation

deavmi
Copy link
Contributor

@deavmi deavmi commented Dec 6, 2023

See more here.

- Added new interface
- Added missing imports
- Moved to the `interfaces` module
- Updated API to take in a `DNodeGenerator` as the first argument to `pool(..., ...)`
This reverts commit 4f92a29.
- Added an implementation of the `IPoolManager` interface
- Now constructs a new `IPoolManager` on constructions
- Added a templatised variant of the `pool(Statement)` method
- Added a templatised variant of the `pool(Statement)` method
- The `pool(Statement)` method now uses the `poolT!(DNodeType, EntityType)(EntityType)` method
- Removed the templatised `poolT!(DNodeType, EntityType)(EntityType)` method
- Added `poolExpression(Expression expression)`
- Added `poolVariable(Variable variable)`
- Added `poolStaticVariable(Variable variable)`
- Added `poolFuncDec(Function func)`
- Removed uneeded import
- Removed the templatised `poolT!(DNodeType, EntityType)(EntityType)` method
- Implemented `poolExpression(Expression expression)`
- Implemented `poolVariable(Variable variable)`
- Implemented `poolStaticVariable(Variable variable)`
- Implemented `poolFuncDec(Function func)`
- No longer takes in a `DNodeGenerator`

AccessDNode

- No longer takes in a `DNodeGenerator`
- Save the incoming `Entity`
- Updated `initName()` to use the `toString()` of the `Entity`

ClassVirtualInit

- No longer takes in a `DNodeGenerator`
- Save the incoming `Clazz`
- Updated `initName()` to use the `toString()` of the `Clazz`

ClassStaticNode

- No longer takes in a `DNodeGenerator`
- Save the incoming `Clazz`
- Updated `initName()` to use the `toString()` of the `Clazz`

ObjectInitializationNode

- No longer takes in a `DNodeGenerator`

VariableNode

- No longer takes in a `DNodeGenerator`
- Updated `initName()` to use the `toString()` of the `Variable`

FuncDecNode

- No longer takes in a `DNodeGenerator`
- Updated `initName()` to use the `toString()` of the `Function`

ModuleVariableDeclaration

- No longer takes in a `DNodeGenerator`
- Updated `initName()` to use the `toString()` of the `Variable`

StaticVariableDeclaration

- No longer takes in a `DNodeGenerator`
- Updated `initName()` to use the `toString()` of the `Variable`

VariableAssignmentNode

- No longer takes in a `DNodeGenerator`
- Updated `initName()` to use the `toString()` of the `VariableAssignment`
- No longer takes in a `DNodeGenerator` for its constructor
- We no longer require it
- No longer pass a `DNodeGenerator` to the `DNodeType(...)`s created in `poolT!(...)(...)`

PoolManager (unittests)

- Updated unittests
- The `addFunctionDef(...)` method now takes in an extra first argument which is the `IPoolManager` it
should use when it constructs its `DFunctionInnerGenerator`

DNode

- Removed the `DNodeGenerator` instance (i.e. the `dnodegen` field)
- Removed the `Resolver` instance (i.e. the `resolver` field)
- Calling `pool(Statement entity)` will now forward that call to the `IPoolManager`'s `pool(Statement)`
- Calling `DNodeType poolT(DNodeType, EntityType)(EntityType entity)` will now forward that call to the `IPoolManager`'s `pool(Statement)` with the correct types decided at compile-time using static if's
- `objectInitialize(Clazz clazz, NewExpression newExpression)` now constructs a `ObjectInitializationNode` with
its new API
- `pool_module_vardec(Variable entity)` now constructs a `ModuleVariableDeclaration` with its new API
- When `generalStatement(Container c, Context context, Statement entity)` comes across a function definition
(i.e. a `Function`) and has to add its function definition it now uses the updated `addFunctionDef(...)`
- `poolClassStatic(Clazz clazz)` now constructs a `ClassStaticNode` with its new API

DFunctionInnerGenerator

- Constructor now accepts an `IPoolManager` instance

DNodeGenerator

- Constructor now accepts an `IPoolManager` instance
- We now use the `IPoolManager` as our pooling mechanism
- When we call `dependencyCheck()` we now first construct the pooling mechanism we want to use
by constructing some kind-of `IPoolManager`, we then pass this to the constructor for the
`DNodeGenerator`
@deavmi deavmi self-assigned this Dec 6, 2023
- Added `poolModuleVariableDeclaration(Variable variable)`
- Impemented `poolModuleVariableDeclaration(Variable variable)`
- `pool_module_vardec(Variable entity)` now calls `poolModuleVariableDeclaration(Variable)` from `IPoolManager`
- Removed the static `nodePool`
- Added some stuff
- Nah, removed that
- Added `poolClassStatic(Clazz clazz)`
- Implemented `poolClassStatic(Clazz clazz)`
- Calling `poolClassStatic(Clazz clazz)` now calls `IPoolManager`'s `poolClassStatic(Clazz)`
- Documented module
- Documented module
@deavmi
Copy link
Contributor Author

deavmi commented Dec 27, 2023

Updated with latest code from vardec_varass โœ”๏ธ

@deavmi
Copy link
Contributor Author

deavmi commented Feb 26, 2024

We must merge this tomorrow.

@deavmi
Copy link
Contributor Author

deavmi commented Feb 27, 2024

Looks good to me merging...

@deavmi deavmi merged commit df6dfe1 into vardec_varass_dependency Feb 27, 2024
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant