Unified weak modifier parsing logic into fields.rs for extensibility.
Changes:
- fields.rs: Add weak handling in visibility block parser (~40 lines)
- parse_weak_field() unified function for all weak parsing
- Visibility block now supports "public { weak parent }" syntax
- mod.rs: Delegate WEAK parsing to fields.rs (thin wrapper)
- Removed inline processing, now calls parse_weak_field()
Tests:
- phase285_weak_visibility_block.hako - public { weak parent }
- phase285_weak_mixed_members.hako - weak + method + visibility
Results:
- All 6 existing Phase 285A1 tests pass
- All 2 new tests pass
- Smoke tests: 46 PASS, 1 FAIL (pre-existing, unrelated)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
27 lines
429 B
Plaintext
27 lines
429 B
Plaintext
box Node {
|
|
weak parent
|
|
public { name }
|
|
|
|
birth() {
|
|
me.name = "Node"
|
|
}
|
|
|
|
setParent(p) {
|
|
me.parent = weak(p)
|
|
}
|
|
|
|
getName() {
|
|
return me.name
|
|
}
|
|
}
|
|
|
|
static box Main {
|
|
main() {
|
|
local n1 = new Node()
|
|
local n2 = new Node()
|
|
n1.setParent(n2) // ✅ weak field + method
|
|
print("OK: mixed members (weak + method + visibility)")
|
|
return 0
|
|
}
|
|
}
|