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 # 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 ## General Pipeline
- Transform a single file into a `CompilationUnit` AST node. - Transform a single file into a `CompilationUnit` AST node.
- Gather all `CompilationUnit`s and determine which modules need to be built. - Gather all `CompilationUnit`s and determine which modules need to be built.
- A module corresponds to one syntactical namespace `ns`, but not its children! - 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`. 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 - 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: the above examples, the following DmModules would be created, with their appropriate contents:
- `pub ns std`: *no contents, only metadata.* - `pub ns std`: *no contents, only metadata.*
- `pub ns std::core`: - `pub ns std::core`:
- `pub fn std::core::foo` - `pub fn std::core::foo`
- `ns std::core::bar` - `ns std::core::bar`
- `fn std::core::bar::baz` - `fn std::core::bar::baz`
- `prv fn std::core::bar::hello`: only accessible inside `std::core::bar`. - `prv fn std::core::bar::hello`: only accessible inside `std::core::bar`.
## More Namespace Rules ## More Namespace Rules
Top-level namespace declaration: Top-level namespace declaration:
``` ```
decl pub ns std decl pub ns std
``` ```
Nested namespace declaration and members: Nested namespace declaration and members:
``` ```
ns std::core // indicates that all members of this file are in the std::core namespace 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 ## Example of std lib would be coded
std/std.dm std/std.dm
``` ```
decl pub ns std { decl pub ns std {
decl pub ns core, http, json decl pub ns core, http, json
@ -72,6 +81,7 @@ decl pub ns std {
``` ```
std/core/core.dm std/core/core.dm
``` ```
ns std ns std
@ -82,6 +92,7 @@ decl pub ns core {
``` ```
std/core/array.dm std/core/array.dm
``` ```
ns std::core ns std::core
@ -119,6 +130,7 @@ pub ns array {
``` ```
std/core/hkt/monad.dm std/core/hkt/monad.dm
``` ```
ns std::core::hkt ns std::core::hkt
@ -132,6 +144,7 @@ pub hkt Monad<T = Self>[a] {
``` ```
std/core/string.dm std/core/string.dm
``` ```
ns std::core ns std::core