From c8ff1d0fa2a1cf696e8d398ec27ed051ca50476a Mon Sep 17 00:00:00 2001 From: Jesse Brault Date: Thu, 22 May 2025 15:02:29 -0500 Subject: [PATCH] Add todos. --- TODO.md | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/TODO.md b/TODO.md index a942599..701cdf5 100644 --- a/TODO.md +++ b/TODO.md @@ -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[a] { ``` std/core/string.dm + ``` ns std::core