Skip to content

Conversation

@DominicPM
Copy link
Contributor

@DominicPM DominicPM commented Jan 31, 2026

Move all tests from Micro_Rust_Shallow_Embedding.thy into a new dedicated test theory file organized by language feature category.

Changes:

  • Create Micro_Rust_Shallow_Embedding_Tests.thy with tests organized into 21 sections covering all Micro Rust syntax features
  • Add missing shallow translations for compound assignment operators (-=, *=, %=, <<=, >>=) in Core_Syntax.thy and Micro_Rust_Shallow_Embedding.thy
  • Fix double negation (!!) parsing by adding explicit syntax rule and AST translation to expand to nested single negations
  • Fix double dereference (**) parsing similarly
  • Add tests for error propagation (?), assert_eq!/assert_ne!, signed casts (i32, i64), and all compound assignment operators
  • Update ROOT to include new test theory

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@DominicPM DominicPM changed the title Extract and expand Micro Rust shallow embedding testsMicro rust grammar unit tests Extract and expand Micro Rust shallow embedding tests Jan 31, 2026
- Make pattern translations total and tolerate wrapper forms to avoid Match in
  the bcase frontend.
- Allow nested patterns in constructor args by expanding collection/translation
  logic in Basic_Case_Expression.
- Normalize tuple patterns into Pair/TNil shape in the shallow match frontend.
- Improve shallow match arg translation to distinguish bindings vs constructors
  and handle nested tuple patterns.
- Add nested-pattern showcase/regression tests (Option/Result, tuples, wildcards,
  if-let and let-else forms).

Closes awslabs#65.

Signed-off-by: Dominic Mulligan <dominic.p.mulligan@gmail.com>
Can now use Boolean-valued pattern guards, for example:

```rust
match x with {
  Some(x) if x > 0 => ...,
  None => ...,
  _otherwise => ...
}
```

Closes awslabs#67.

Signed-off-by: Dominic Mulligan <dominic.p.mulligan@gmail.com>
Move all tests from Micro_Rust_Shallow_Embedding.thy into a new dedicated
test theory file organized by language feature category.

Changes:
- Create Micro_Rust_Shallow_Embedding_Tests.thy with tests organized into
  21 sections covering all Micro Rust syntax features
- Add missing shallow translations for compound assignment operators
  (-=, *=, %=, <<=, >>=) in Core_Syntax.thy and Micro_Rust_Shallow_Embedding.thy
- Fix double negation (!!) parsing by adding explicit syntax rule and
  AST translation to expand to nested single negations
- Fix double dereference (**) parsing similarly
- Add tests for error propagation (?), assert_eq!/assert_ne!, signed
  casts (i32, i64), and all compound assignment operators
- Update ROOT to include new test theory

Signed-off-by: Dominic Mulligan <dominic.p.mulligan@gmail.com>
@DominicPM DominicPM force-pushed the micro-rust-grammar-unit-tests branch from c98af44 to f761dfe Compare February 3, 2026 19:46
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