@[reducible, inline]
Equations
- ParseFun = (Lean.Environment → String → EIO ParseError ParseOutput)
Instances For
Instances For
Instances For
Instances For
Instances For
Equations
- printException (Except.ok a) = throw (IO.userError "printException called on Except.ok")
- printException (Except.error e) = e.toMessageData.toString
Instances For
unsafe def
elabIntoEIO
{α : Type}
(env : Lean.Environment)
(typeName : Lean.Expr)
(stx : Lean.Syntax)
:
Instances For
Equations
- region0Expr = (Lean.Expr.const `MLIR.AST.Region []).app (Lean.Expr.const `Nat.zero [])
Instances For
Equations
- op0Expr = (Lean.Expr.const `MLIR.AST.Op []).app (Lean.Expr.const `Nat.zero [])
Instances For
Parse Lean.Syntax
into MLIR.AST.Region
.
This runs the Lean frontend stack and adds it to the TCB. It should be safe (if we trust the lean parser) since we ensure that the types match: see https://leanprover-community.github.io/mathlib4_docs/Std/Util/TermUnsafe.html#Std.TermUnsafe.termUnsafe_
Equations
- elabRegion env stx = do let reg ← elabRegion.unsafe_impl_1 env stx pure reg
Instances For
Parse Lean.Syntax
into MLIR.AST.Op
.
This runs the Lean frontend stack and adds it to the TCB. It should be safe (if we trust the lean parser) since we ensure that the types match: see https://leanprover-community.github.io/mathlib4_docs/Std/Util/TermUnsafe.html#Std.TermUnsafe.termUnsafe_
Equations
- elabOp env stx = elabOp.unsafe_impl_1 env stx
Instances For
def
mkParseFun
{ParseOutput : Type}
(syntaxcat : Lean.Name)
(ntparser : Lean.Syntax → EIO ParseError ParseOutput)
(s : String)
(env : Lean.Environment)
:
EIO ParseError ParseOutput
Equations
- mkParseFun syntaxcat ntparser s env = match Lean.Parser.runParserCategory env syntaxcat s with | Except.error msg => throw msg | Except.ok syn => ntparser syn
Instances For
Equations
- regionParser env = mkNonTerminalParser `mlir_region (elabRegion env) env
Instances For
def
parseRegionFromFile
{α : Type}
(fileName : String)
(regionParseFun : MLIR.AST.Region 0 → Except ParseError α)
:
Equations
- One or more equations did not get rendered due to their size.