From: Brendan Hansen Date: Sat, 4 Feb 2023 22:17:23 +0000 (-0600) Subject: bugfix? and added docs X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=e8fef2675e49640807b4e59b84ff187f381acbed;p=onyx.git bugfix? and added docs --- diff --git a/compiler/src/types.c b/compiler/src/types.c index b12f7c67..86d4b083 100644 --- a/compiler/src/types.c +++ b/compiler/src/types.c @@ -390,6 +390,12 @@ Type* type_build_from_ast(bh_allocator alloc, AstType* type_node) { return NULL; } + if ((*member)->type->kind == Type_Kind_Struct + && (*member)->type->Struct.status == SPS_Start) { + s_node->pending_type_is_valid = 0; + return NULL; + } + mem_alignment = type_alignment_of((*member)->type); if (mem_alignment <= 0) { onyx_report_error((*member)->token->pos, Error_Critical, "Invalid member type: %s. Has alignment %d", type_get_name((*member)->type), mem_alignment); diff --git a/docs/ideas/high_level_goals.md b/docs/ideas/high_level_goals.md new file mode 100644 index 00000000..66c6bc45 --- /dev/null +++ b/docs/ideas/high_level_goals.md @@ -0,0 +1,12 @@ +High-Level Goals + +There are many ideas that are wizzing around my head +when I think about the future of Onyx, and I'm having +a hard-time deciding what needs to be done and when. +I think writing everything out and creating a (rough) +timeline will be beneficial to me and the future of +the language. + + + + diff --git a/docs/ideas/mapped_directories.md b/docs/ideas/mapped_directories.md index f9bc94d3..83e9eff1 100644 --- a/docs/ideas/mapped_directories.md +++ b/docs/ideas/mapped_directories.md @@ -1,2 +1,19 @@ Mapped Directories -================== \ No newline at end of file +================== + +I am thinking about complicating how the file resolution +system works when loading new files. Currently, it is +intentionally very simple. There is a global "search path" +that will be sequentially appended to the file path being +loaded, and the first full path that is a file will be used. +This makes it easy to use, but also causes some confusion. + +I think it would be worth investigating using a *relative only* +scheme for file resolution, UNLESS you specify the full path, +or a *mapped directory* to use as the base directory. + +For example, instead of relying on "/usr/share/onyx" to be in +the search path to make "core/std" work, we would instead have +"core" be a mapped directory to "/usr/share/onyx/core". Then, +you would say, `#load "core:std"` or `#load core "std"` to +specify the base path. diff --git a/docs/ideas/templated_projects.md b/docs/ideas/templated_projects.md new file mode 100644 index 00000000..4f066ec8 --- /dev/null +++ b/docs/ideas/templated_projects.md @@ -0,0 +1,4 @@ +Templated Projects +================== + +