feat: Expression creation and pretty printing

This commit is contained in:
Leni Aniva 2024-07-15 11:42:02 -07:00
parent a7fe7cbd7c
commit 193d94e798
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
2 changed files with 11 additions and 3 deletions

View File

@ -17,6 +17,13 @@ def nameToStr (s: String) : Name := s.toName
@[export pantograph_name_is_inaccessible]
def isInaccessible (n: Name) : Bool := n.isInaccessibleUserName
@[export pantograph_mk_app_meta_m]
def mkAppM (constName : Name) (xs : Array Expr) : MetaM Expr := Meta.mkAppM constName xs
@[export pantograph_pp_expr]
def ppExpr (e: Expr) := Meta.ppExpr e
-- Mirrors Lean's LocalDecl
structure LocalDecl where
-- Default value is for testing

View File

@ -78,9 +78,10 @@ def createCoreState (imports: Array String): IO Core.State := do
(trustLevel := 1)
return { env := env }
@[export pantograph_create_meta_context]
def createMetaContext: IO Lean.Meta.Context := do
return {}
@[export pantograph_meta_context]
def metaContext: Lean.Meta.Context := {}
@[export pantograph_meta_state]
def metaState: Lean.Meta.State := {}
@[export pantograph_env_catalog_m]
def envCatalog: CoreM Protocol.EnvCatalogResult :=