fix: use correct number of none patterns for antiquotation splice
This commit is contained in:
parent
02d0a89229
commit
f37b700e6e
2 changed files with 6 additions and 1 deletions
|
|
@ -131,7 +131,7 @@ private partial def quoteSyntax : Syntax → TermElabM Syntax
|
|||
let arr ← match k with
|
||||
| `optional => `(match $[$ids:ident],* with
|
||||
| $[some $ids:ident],* => $(quote inner)
|
||||
| none => Array.empty)
|
||||
| $[_%$ids],* => Array.empty)
|
||||
| _ =>
|
||||
let arr ← ids[:ids.size-1].foldrM (fun id arr => `(Array.zip $id $arr)) ids.back
|
||||
`(Array.map (fun $(← mkTuple ids) => $(inner[0])) $arr)
|
||||
|
|
|
|||
5
tests/lean/run/1124.lean
Normal file
5
tests/lean/run/1124.lean
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
open Lean
|
||||
syntax "foo" (ident ident)? : term
|
||||
|
||||
variable (x y : Option Syntax)
|
||||
example : MacroM Syntax := `(foo $[$x:ident $y:ident]?)
|
||||
Loading…
Add table
Reference in a new issue