lean4-htt/tests/lean/run/hexnum.lean
Leonardo de Moura f9e140838e
feat: hexnum parser (#10716)
This PR adds a new helper parser for implementing parsers that contain
hexadecimal numbers. We are going to use it to implement anchors in the
`grind` interactive mode.
2025-10-08 21:12:03 +00:00

24 lines
440 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax "#" noWs hexnum : term
open Lean in
macro_rules
| `(#$n:hexnum) => `(($(quote n.getHexNumSize), $(quote n.getHexNumVal)))
/-- info: (4, 44733) : Nat × Nat -/
#guard_msgs in
#check #aebd
/-- info: (1, 10) : Nat × Nat -/
#guard_msgs in
#check #a
/-- info: (2, 16) : Nat × Nat -/
#guard_msgs in
#check #10
/-- info: (2, 5) : Nat × Nat -/
#guard_msgs in
#check #05
/-- info: (3, 10) : Nat × Nat -/
#guard_msgs in
#check #00a