Skip to content

Commit

Permalink
chore: add match_pattern attribute for Std.BitVec.ofNat (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
leodemoura authored Oct 24, 2023
1 parent fb56324 commit ab21923
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Std/Data/BitVec/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ instance : OfNat (BitVec n) i where ofNat := .ofNat n i
scoped syntax:max term:max noWs "#" noWs term:max : term
macro_rules | `($i#$n) => `(BitVec.ofNat $n $i)

/- Support for `i#n` notation in patterns. -/
attribute [match_pattern] BitVec.ofNat

/-- Unexpander for bit vector literals. -/
@[app_unexpander BitVec.ofNat] def unexpandBitVecOfNat : Lean.PrettyPrinter.Unexpander
| `($(_) $n $i) => `($i#$n)
Expand Down

0 comments on commit ab21923

Please sign in to comment.