File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -771,20 +771,20 @@ def withMacroExpansion [Monad n] [MonadControlT TermElabM n] (beforeStx afterStx
771771 withPushMacroExpansionStack beforeStx afterStx <| runInBase x
772772
773773/--
774- Reference a fixed term elaborator by index.
775- This syntax should never be constructed directly; rather it is an implementation detail of
776- `Lean.Elab.Term.elabToSyntax`.
774+ Node kind for the `Lean.Elab.Term.elabToSyntax` functionality.
775+ It is an implementation detail of `Lean.Elab.Term.elabToSyntax`.
777776-/
778- protected def _root_.Lean.Parser.Term.fixedTermElab := leading_parser
779- Lean.Parser.Term.num
777+ protected def _root_.Lean.Parser.Term.elabToSyntax : Unit := ()
778+
779+ builtin_initialize Lean.Parser.registerBuiltinNodeKind ``Lean.Parser.Term.elabToSyntax
780780
781781/-- Refer to the given term elaborator by a scoped `Syntax` object. -/
782782def elabToSyntax (fixedTermElab : FixedTermElab) (k : Term → TermElabM α) : TermElabM α := do
783783 let ctx ← read
784784 withReader (fun ctx => { ctx with fixedTermElabs := ctx.fixedTermElabs.push fixedTermElab.toFixedTermElabRef }) do
785- k ⟨mkNode ``Lean.Parser.Term.fixedTermElab #[Syntax.mkNatLit ctx.fixedTermElabs.size]⟩
785+ k ⟨mkNode ``Lean.Parser.Term.elabToSyntax #[Syntax.mkNatLit ctx.fixedTermElabs.size]⟩
786786
787- @[builtin_term_elab Lean.Parser.Term.fixedTermElab ] def elabFixedTermElab : TermElab := fun stx expectedType? => do
787+ @[builtin_term_elab Lean.Parser.Term.elabToSyntax ] def elabFixedTermElab : TermElab := fun stx expectedType? => do
788788 let some idx := stx[0 ].isNatLit? | throwUnsupportedSyntax
789789 let some fixedTermElab := (← read).fixedTermElabs[idx]?
790790 | throwError "Fixed term elaborator {idx} not found. There were only {(← read).fixedTermElabs.size} fixed term elaborators registered."
You can’t perform that action at this time.
0 commit comments