feat(ast): struct definitions and member access - #73
Merged
Conversation
Parse struct Tag { … } and anonymous structs into type::structure layout,
implement . and -> via MemberAccess + FieldAddress IR, and cover member
R/W, arrow, and nested structs with functional StructsTest.
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
This was referenced Jul 24, 2026
Exercise more FieldAddress / MemberAccess paths to avoid Coveralls regression on the struct-member-access PR.
- Mutate incomplete structure layout via shared members so self-ref `struct Node *next` and forward tags observe completed fields - ArrayAccess yields address for structure elements (`a[i].x` stores) - Fix multi-level pointer accumulation in Identifier::getFundamentalType - Tighten `.` vs `->` (reject `p.x` on pointers; dual-type nested still OK) - Regression tests for self-ref, array-of-struct, double pointer arrow, and illegal dot-on-pointer
Incomplete struct objects and assigning nested/array dual-type aggregates as whole values are diagnosed instead of miscompiling. Tighten -> so dual-type nested members require dot, not arrow.
rieske
added a commit
that referenced
this pull request
Jul 25, 2026
Replay tip-quality infrastructure onto #73 so later PRs stay feature-focused: - Expression dual-type: setTypeAndResult / setResultOnly / setAggregateAddressResult - Drop ArrayAccess::yieldsAddress in favor of holdsAggregateAddress() - TypeQuery + productCanAssignFrom / incompleteStructure free functions - Split SemanticAnalysisVisitor into Calls / Expressions / Statements - Split CSNB into ContextualSyntaxNodeBuilder + CSNB_Creators - Shared assignSourceType / resolveMemberBase helpers - Named r10 via getIndirectCallTargetRegister (for later indirect calls) Brace initializers and function pointers remain out of scope for this PR.
rieske
added a commit
that referenced
this pull request
Jul 25, 2026
Replay tip-quality infrastructure onto #73 so later PRs stay feature-focused: - Expression::ValueForm (Scalar / AggregateAddress) - setTypeAndResult / setAggregateAddressResult; drop setResultOnly - TypeQuery + productCanAssignFrom / productAssignFailureMessage - Split SemanticAnalysisVisitor into Calls / Expressions / Statements - Split CSNB into ContextualSyntaxNodeBuilder + CSNB_Creators - Shared assignSourceType / resolveMemberBase helpers No function-pointer or brace-initializer surface in this PR.
rieske
force-pushed
the
feature/struct-member-access
branch
2 times, most recently
from
July 25, 2026 07:31
12e5cc8 to
f0976fc
Compare
- Expression dual ownership: expressionType/valueType/ValueForm - TypeQuery productCanAssignFrom + arraySubscriptInfo - symbols::AnnotationStore on AST; AddressPlan (Field/Index); CallPlan - SA/CSNB splits; resolveMemberBase trusts ValueForm No brace initializers or function-pointer surface.
rieske
force-pushed
the
feature/struct-member-access
branch
from
July 25, 2026 07:54
f0976fc to
b70a025
Compare
- Remove dead FP codegen (functionAddress, indirect Call, r10 helper) - Call is direct-only until #75 - Drop unused FunctionDesignatorPlan from AddressPlan on this PR - Unit tests: TypeQuery + AnnotationStore - More StructsTest paths (errors, nested, sizeof, whole assign)
rieske
added a commit
that referenced
this pull request
Jul 25, 2026
Re-introduce FunctionDesignatorPlan, indirect Call, and StackMachine functionAddress / callProcedureIndirect on the FP tip after #73 removed them to recover Coveralls.
rieske
added a commit
that referenced
this pull request
Jul 25, 2026
Re-introduce FunctionDesignatorPlan, indirect Call, and StackMachine functionAddress / callProcedureIndirect on the FP tip after #73 removed them to recover Coveralls.
- Cover CSNB unimplemented stubs + doNothing/notImplementedYet - Expression dual-type helpers unit tests - TypeQuery dual-subscript fallback / incomplete-member cases - Remove dual MemberAccess offset/baseIsPointer (FieldPlan only) - More StructsTest (const, short/unsigned not implemented)
rieske
added a commit
that referenced
this pull request
Jul 25, 2026
Re-introduce FunctionDesignatorPlan, indirect Call, and StackMachine functionAddress / callProcedureIndirect on the FP tip after #73 removed them to recover Coveralls.
rieske
force-pushed
the
feature/struct-member-access
branch
from
July 25, 2026 11:33
109220e to
f62d65f
Compare
rieske
added a commit
that referenced
this pull request
Jul 25, 2026
Re-introduce FunctionDesignatorPlan, indirect Call, and StackMachine functionAddress / callProcedureIndirect on the FP tip after #73 removed them to recover Coveralls.
rieske
added a commit
that referenced
this pull request
Jul 25, 2026
Re-introduce FunctionDesignatorPlan, indirect Call, and StackMachine functionAddress / callProcedureIndirect on the FP tip after #73 removed them to recover Coveralls.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
structdefinitions (named + anonymous) →type::structurestruct Sreferences after definitionMemberAccessAST +FieldAddressIR for./->StructsTestStack
PR D of remaining track (after arrays/casts). Next: initializers / FP / …
Test plan
ctest