You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: restore extern coverage after rebase onto main (#90 merged)
PR #90 landed `extern fn` / `extern type` parsing and codegen on main while
this branch was in review. Restore the SPEC.md coverage to match what
actually shipped:
- 1.2: re-add `extern` to the keyword list.
- 2.1: re-add `extern_fn_decl` and `extern_type_decl` to `top_level`.
Note the parser uses two separate productions that both feed back into
`TopFn` / `TopType` AST variants (with `FnExtern` / `TyExtern` as the
body kind); the spec describes the surface grammar, not the AST shape.
- 2.10: re-introduce, but with the actual parsed shape (the productions
accept `type_params`, the fn form accepts `effects`, and both accept
optional `visibility`) rather than the simplified form from the original
PR. Clarify the runtime contract: extern fn lowers to a Wasm import,
extern type generates no artifact.
- 8.1 / 8.2: split the `TopFn` population case into the
`FnExtern` / non-`FnExtern` variants so the description matches the
guard pattern in lib/codegen.ml. Hard-coded `"env"` Wasm module name is
called out explicitly.
Also update the lib/codegen.ml doc-comment on `func_indices` to mention
both `TopFn` paths (defined and extern) and clarify that insertion order
is source order.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments