crosslang/golang-lean/GolangLean/Eval.lean
Maximus Gorog fd3d42ae33 Add 'golang-lean/' from commit 'f5f17019224c6a6c319387214ceb8e29d09251c6'
git-subtree-dir: golang-lean
git-subtree-mainline: 6487c7046f
git-subtree-split: f5f1701922
2026-05-12 02:59:14 -06:00

25 lines
742 B
Text

import GolangLean.AST
import GolangLean.Env
import GolangLean.Error
namespace GolangLean
/-! # Evaluator — operational big-step interpreter over the AST.
Mirror of octive-lean's `Eval`. Monad stack `ExceptT GoError (StateT Env IO)`,
chosen for the same reason: state survives non-local control flow (defer,
panic, goroutine spawn) carried as exceptions. -/
abbrev EvalM := ExceptT GoError (StateT Env IO)
partial def evalExpr (_e : Expr) : EvalM Value :=
throw (.notImpl "Eval.evalExpr")
partial def evalStmt (_s : Stmt) : EvalM Unit :=
throw (.notImpl "Eval.evalStmt")
def runFile (path : String) : IO UInt32 := do
IO.eprintln s!"golang-lean: would execute {path} (interpreter not yet implemented)"
return 1
end GolangLean