Add examples with cargo run --example support

- Move .mrs files into misses-compiler/examples/ alongside .rs runners
- Add lib.rs exposing parse/codegen for use by example binaries and main.rs
- Fix parser: #[attr] vs #[a => b] disambiguation (look for => before ])
- Fix parser: `for` keyword in `impl Foo for Bar` no longer triggers spread
  (is_spread_for lookahead: must match `for <ident> in $<ident> =>`)
- Add derive_getters.mrs: getter methods via spread iteration
- Add make_id_type.mrs: newtype u64 wrapper with From impls, derive attrs

Run with: cargo run --example hello|derive_builder|declare_table|derive_getters|make_id_type

https://claude.ai/code/session_01Tppkab4eLsL21asHGjQJoF
This commit is contained in:
Claude
2026-03-07 15:35:01 +00:00
parent ed62264870
commit f90953a3bb
14 changed files with 213 additions and 21 deletions
+11
View File
@@ -0,0 +1,11 @@
// hello.mrs — smoke test
// Demonstrates: single ident binding, ident construction with #[a => b]
macro hello! {
$name:ident => {
T~{
pub fn #[say => $name]() -> &'static str {
"hello from the macro!"
}
}
}
}