Skip to content

Parser: preserve let mut / &mut mutability and send #65

Description

@StreamDemon

Summary

Several parsed tokens are discarded rather than represented:

  • let mut x — the mut is dropped (let _mutable = …); Stmt::Let has no mutable flag.
  • &mut in unary borrow expressions — mutability dropped (let _mutable = …); only op: "&" survives.
  • send expr; — lowered to a plain Stmt::Expr, losing send semantics.

Part of the v0.6.x parser-completeness work (see crates/AGENTS.md "Implemented subset").

Spec

  • §4 ownership/borrowing (& / &mut); §5.3 let bindings; §8 actors send (§8.2, §16 send_stmt).

Scope

  • Add a mutable flag to Stmt::Let and thread mut through.
  • Preserve &mut vs & on borrow expressions in the AST.
  • Model send as its own statement/expression node rather than a bare Stmt::Expr.
  • Unit tests asserting the preserved flags/nodes.

Notes

Low risk, mostly mechanical AST additions. Needed before any borrow-check or actor-semantics stage can consume the AST.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions