Skip to content

Add module visibility syntax spike - #8

Merged
miselin merged 1 commit into
mainfrom
agent/visibility-syntax-spike
Aug 10, 2026
Merged

Add module visibility syntax spike#8
miselin merged 1 commit into
mainfrom
agent/visibility-syntax-spike

Conversation

@miselin

@miselin miselin commented Aug 10, 2026

Copy link
Copy Markdown
Owner

What changed

  • Replace the declaration-level public boolean with file, module, and external visibility tiers.
  • Add pub(module) syntax alongside existing pub syntax.
  • Add visibility blocks such as pub(module) { ... }, desugared during CST-to-surface lowering.
  • Preserve visibility for functions, globals, and types, including LLVM linkage behavior and LSP display details.
  • Add parser/pipeline coverage and update the grammar and language documentation.

Why

This establishes a readable syntax for sharing declarations across files in one module without exporting them at external/linker scope. The block form reduces repetitive modifiers while remaining surface sugar.

Validation

  • opam exec -- dune build
  • opam exec -- dune runtest
  • git diff --check

The standalone Lark example validator was not run successfully because the active Python environment does not have the lark package installed.

Follow-up

Module identity and visibility enforcement across imported files remain the next semantic slice. This PR establishes the syntax and AST representation needed for that work.

@miselin miselin added ai-generated This PR/code was majority generated by AI and may require deeper review. enhancement New feature or request labels Aug 10, 2026 — with ChatGPT Codex Connector
@miselin
miselin marked this pull request as ready for review August 10, 2026 02:40
@miselin
miselin merged commit f353a0b into main Aug 10, 2026
6 checks passed
@miselin
miselin deleted the agent/visibility-syntax-spike branch August 10, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated This PR/code was majority generated by AI and may require deeper review. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant