Skip to content

Parse member access modifiers and qualified proto contracts - #1282

Merged
LunaStev merged 3 commits into
wavefnd:masterfrom
LunaStev:feat/object-member-syntax
Dec 4, 2026
Merged

LunaStev merged 3 commits into
wavefnd:masterfrom
LunaStev:feat/object-member-syntax

Conversation

@LunaStev

@LunaStev LunaStev commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Parse qualified named proto implementations such as proto graphics::Renderer : Local. Keep the target type separate, retain each contract segment's source range, and point malformed paths at the offending token.
  • Record explicit pub, priv, and protected modifiers and their spans on struct fields and on methods declared in a struct or proto. The parsed AST distinguishes an omitted modifier from an explicit one. In struct S { priv: i32; }, priv remains the field name.
  • Allow syntax inspection with build --emit=ast. Until access control is implemented, check and code-generating builds report E3001 at the explicit modifier, including in imported declarations and unused generic types.
  • Add portable case 144 for all eleven contextual names and case 145 for AST-only member modifiers and a qualified named proto. Case 145 also requires the semantic checker to reject the first explicit modifier with the expected diagnostic. The case source gate checks the exit status, file, code, and exact label. The CLI regression verifies rejection during IR generation.
  • Set the compiler and package version to 0.0.1-alpha.
  • Repair the two FreeBSD amd64 timeouts in the original CI run. Runtime validation restores the package job’s pinned input cache and verifies the image digest. Guest provisioning installs git-tiny from the FreeBSD repository without fetching the remote file-ownership index. Native package validation has its own deadline and still requires a successful guest exit and clean shutdown.

Motivation

The frontend needs to represent these declarations before it can implement visibility checks or resolve named contracts. Accepting access modifiers during code generation today would silently ignore their intended restrictions.

Closes #1137
Closes #1165
Closes #1140
Closes #1141

Target and compatibility impact

Existing module-level pub, unmarked members, inherent proto methods, and unqualified named proto declarations retain their syntax. All eleven contextual words remain usable as identifiers outside their declaration contexts. LLVM and Whale share the semantic diagnostic for explicit member access. Qualified named contracts retain the existing diagnostic for unsupported semantic lowering.

Validation

  • cargo +1.89.0 test --workspace --all-targets --locked --offline --jobs 2 passed all 713 tests across 86 suites on 8f59bc5f. The native identifier regression exercises all eleven words as function, parameter, variable, and field names.
  • The native Wave case runner passed all eight existing method cases (47, 48, 54, 55, 56, 98, 120, and 123).
  • Checked the modifier diagnostic with both LLVM and Whale and with combined AST and IR output. Cross-compiled the IOCP runtime example and the Windows Unix-socket fixture to Windows amd64 and arm64 objects on Linux.
  • Workspace Clippy with -D warnings, rustfmt, the repository function-spacing check, and git diff --check passed.
  • The case-source gate passed all 645 files. The Linux amd64 native shard that previously failed passed all 90 cases locally. Both new cases passed on Linux amd64 and in the FreeBSD amd64 compile-only suite.
  • Verified wavec --version, the Cargo package ID, Meson project metadata, and the FreeBSD archive name against 0.0.1-alpha.
  • CI for the current head.

Checklist

  • All commits include DCO sign-offs.
  • Parser, semantic, CLI, and native execution tests cover the changes.
  • The source diagnostic identifies the unsupported modifier.
  • The change preserves the license boundary between the compiler and the standard library.

…acts

Keep contextual names usable as identifiers and retain the source spans of explicit modifiers and contract path segments. Diagnose explicit member access during semantic checking until visibility rules are implemented.

Signed-off-by: LunaStev <luna@lunastev.org>

@LunaStev LunaStev left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

Reuse the checksum-pinned FreeBSD image for runtime tests and provision minimal Git before starting the guest validation deadline. Exercise contextual names and syntax-only declarations through the shared Wave case runner.

Signed-off-by: LunaStev <luna@lunastev.org>
Signed-off-by: LunaStev <luna@lunastev.org>
@LunaStev
LunaStev merged commit 07910d6 into wavefnd:master Dec 4, 2026
99 of 100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant