Skip to content

Fix exported prefix macro#62

Open
MesTTo wants to merge 2 commits into
trueagi-io:mainfrom
MesTTo:pr/mork-prefix-macro-api
Open

Fix exported prefix macro#62
MesTTo wants to merge 2 commits into
trueagi-io:mainfrom
MesTTo:pr/mork-prefix-macro-api

Conversation

@MesTTo

@MesTTo MesTTo commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Makes the already-exported prefix! macro usable from integration tests and downstream callers.

The branch adds the small prefix::Prefix wrapper expected by the macro, qualifies macro dependencies through $crate, and derives the stored prefix through the existing Expr::prefix_non_proper() behavior.

Validation:

  • cargo +nightly-2026-06-01 test -p mork --test prefix_macro with RUSTFLAGS='-C target-cpu=native' and CARGO_WORKSPACE_DIR set to the branch worktree
  • cargo +nightly-2026-06-01 test -p mork --lib with RUSTFLAGS='-C target-cpu=native'
  • rustfmt --check on kernel/tests/prefix_macro.rs
  • jscpd on kernel/src/lib.rs, kernel/src/space.rs, and kernel/tests/prefix_macro.rs
  • git diff --check

@MesTTo MesTTo marked this pull request as ready for review June 23, 2026 10:23
MesTTo added 2 commits July 4, 2026 22:46
The single test compared the macro's output against prefix_non_proper, the very
primitive the macro calls. Add structural assertions that hold independently of
how the offset is derived (non-empty strict prefix of the encoded span), and a
proper-prefix case: a pattern with a variable stops before the variable and its
path is exactly the lead-in it shares with the ground instantiation.
@MesTTo MesTTo force-pushed the pr/mork-prefix-macro-api branch from 5b7f434 to cb27dd4 Compare July 4, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant