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.
24 lines
440 B
Text
24 lines
440 B
Text
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
|