feat: Export frontend functions

This commit is contained in:
Leni Aniva 2024-09-09 12:30:32 -07:00
parent 4f5950ed78
commit 762a139e78
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
2 changed files with 2 additions and 0 deletions

View File

@ -8,6 +8,7 @@ namespace Lean.FileMap
/-- Extract the range of a `Syntax` expressed as lines and columns. -/
-- Extracted from the private declaration `Lean.Elab.formatStxRange`,
-- in `Lean.Elab.InfoTree.Main`.
@[export pantograph_frontend_stx_range]
protected def stxRange (fileMap : FileMap) (stx : Syntax) : Position × Position :=
let pos := stx.getPos?.getD 0
let endPos := stx.getTailPos?.getD pos

View File

@ -88,6 +88,7 @@ structure TacticInvocation where
namespace TacticInvocation
/-- Return the range of the tactic, as a pair of file positions. -/
@[export pantograph_frontend_tactic_invocation_range]
protected def range (t : TacticInvocation) : Position × Position := t.ctx.fileMap.stxRange t.info.stx
/-- Pretty print a tactic. -/