mini-go-0.3.0.0: Mini Go parser and interpreter
Safe HaskellSafe-Inferred
LanguageHaskell2010

Interpreter.Interpreter

Synopsis

Interpreter

interpret :: Program -> (ResultValue (), Env') Source #

Interpreter entry point. Assumes that program is analyzed successfully.

interpretBlock' :: scope -> (scope -> Env s -> Env s) -> (Env s -> Env s) -> Block -> Result s (StmtResult s) Source #

data StmtResult s Source #

Statement interpretation result.

Constructors

Unit

Result of ordinary statement.

Break

Result of the break statement.

Continue

Result of the continue statement.

Ret (MaybeVoid (RuntimeValue s))

Result of the return statement.

Instances

Instances details
Eq (StmtResult s) Source # 
Instance details

Defined in Interpreter.Interpreter

Methods

(==) :: StmtResult s -> StmtResult s -> Bool #

(/=) :: StmtResult s -> StmtResult s -> Bool #

Utils

Interpret non-void Expression

Primitive values

Cast runtime values