Add todos.

This commit is contained in:
Jesse Brault 2025-05-22 15:02:29 -05:00
parent f5f247e636
commit c8ff1d0fa2

25
TODO.md
View File

@ -1,6 +1,12 @@
# TODO/Plans
## May 2025
- Refactor name-analysis to add custom errors for name-analysis only, which can then be tested.
- Refactor `pub` fields of AST structs into private fields accessed by methods.
## General Pipeline
- Transform a single file into a `CompilationUnit` AST node.
- Gather all `CompilationUnit`s and determine which modules need to be built.
- A module corresponds to one syntactical namespace `ns`, but not its children!
@ -35,21 +41,23 @@
appropriate objects, such as `DmInterface`, `DmImplementation`, `DmFunction`, or `DmConstant`.
- Thus, a `DmModule` is a single-file containing all the code for one namespace, but not its child namespaces. Using
the above examples, the following DmModules would be created, with their appropriate contents:
- `pub ns std`: *no contents, only metadata.*
- `pub ns std::core`:
- `pub fn std::core::foo`
- `ns std::core::bar`
- `fn std::core::bar::baz`
- `prv fn std::core::bar::hello`: only accessible inside `std::core::bar`.
- `pub ns std`: *no contents, only metadata.*
- `pub ns std::core`:
- `pub fn std::core::foo`
- `ns std::core::bar`
- `fn std::core::bar::baz`
- `prv fn std::core::bar::hello`: only accessible inside `std::core::bar`.
## More Namespace Rules
Top-level namespace declaration:
```
decl pub ns std
```
Nested namespace declaration and members:
```
ns std::core // indicates that all members of this file are in the std::core namespace
@ -64,6 +72,7 @@ pub ns array {
## Example of std lib would be coded
std/std.dm
```
decl pub ns std {
decl pub ns core, http, json
@ -72,6 +81,7 @@ decl pub ns std {
```
std/core/core.dm
```
ns std
@ -82,6 +92,7 @@ decl pub ns core {
```
std/core/array.dm
```
ns std::core
@ -119,6 +130,7 @@ pub ns array {
```
std/core/hkt/monad.dm
```
ns std::core::hkt
@ -132,6 +144,7 @@ pub hkt Monad<T = Self>[a] {
```
std/core/string.dm
```
ns std::core