u32 type_get_alignment_log2(Type* type);
Type* type_get_contained_type(Type* type);
+b32 type_is_ready_for_lookup(Type* type);
b32 type_lookup_member(Type* type, char* member, StructMember* smem);
b32 type_lookup_member_by_idx(Type* type, i32 idx, StructMember* smem);
token_toggle_end(field->token);
}
- if (field->expr->type->kind == Type_Kind_Struct) {
- if (field->expr->type->Struct.status != SPS_Uses_Done) {
- YIELD(field->token->pos, "Waiting for struct type to be completed before looking up members.");
- }
- }
-
if (!type_is_structlike(field->expr->type)) {
goto try_resolve_from_type;
}
+ if (!type_is_ready_for_lookup(field->expr->type)) {
+ YIELD(field->token->pos, "Waiting for struct type to be completed before looking up members.");
+ }
+
StructMember smem;
if (!type_lookup_member(field->expr->type, field->field, &smem)) {
if (field->expr->type->kind == Type_Kind_Array) {
}
}
-// If this function returns NULL, then the caller MUST yield because the type may still be constructed in the future.
-// If there was an error constructing the type, then this function will report that directly.
-Type* type_build_from_ast_inner(bh_allocator alloc, AstType* type_node, b32 accept_partial_types) {
+static Type* type_build_from_ast_inner(bh_allocator alloc, AstType* type_node, b32 accept_partial_types) {
if (type_node == NULL) return NULL;
switch (type_node->kind) {
return accept_partial_types ? s_node->pending_type : NULL;
}
- if ((*member)->type->kind == Type_Kind_Struct
- && (*member)->type->Struct.status == SPS_Start) {
+ if ((*member)->type->kind == Type_Kind_Struct && (*member)->type->Struct.status == SPS_Start) {
s_node->pending_type_is_valid = 0;
return accept_partial_types ? s_node->pending_type : NULL;
}
return NULL;
}
+// If this function returns NULL, then the caller MUST yield because the type may still be constructed in the future.
+// If there was an error constructing the type, then this function will report that directly.
Type *type_build_from_ast(bh_allocator alloc, AstType* type_node) {
return type_build_from_ast_inner(alloc, type_node, 0);
}
}
}
+b32 type_is_ready_for_lookup(Type* type) {
+ if (type->kind == Type_Kind_Pointer) type = type->Pointer.elem;
+
+ if (type->kind == Type_Kind_Struct) {
+ return type->Struct.status == SPS_Uses_Done;
+ }
+
+ return 1;
+}
+
static const StructMember slice_members[] = {
{ 0, 0, NULL, "data", NULL, NULL, -1, 0, 0 },
{ POINTER_SIZE, 1, &basic_types[Basic_Kind_U32], "count", NULL, NULL, -1, 0, 0 },
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
the language.
+Optimizing OVM instructions
+---------------------------
+As OVM becomes used more and more because of its improved
+debugging experience when compared to runtimes like Wasmer,
+it would be nice if the runtime was a little faster. As
+I look through the generated instructions, I see a lot of
+potential for some relatively easy improvements that can
+be made. This would still be a larger-endeavour, as
+optimizing is not a simple task. Debug information, basic
+blocks and other tricky things have to be dealt with. I
+think this task would take around 2-3 weeks of focused time
+to get something good.
+[Onyx Website](./website.md)
+--------------
+The domains for the website (https://onyxlang.io) is already
+registered, I just need a good-enough website. It does not
+need to be anything super-fancy, yet. Just links and basic-
+documentation.
+
+
+[Generated Documentation](./doc_format.md)
+-----------------------
+
+
+[Core Library Cleanup](./core_libraries.md)
+--------------------
+
+
+[Project Templates](./templated_projects.md)
+------------------
+
+
+[Bundling Onyx for Distribution](./shipping.md)
+-------------------------------