git @ Cat's Eye Technologies Mascarpone / dbdf822
Support for injecting IO functions. Chris Pressey 3 years ago
1 changed file(s) with 9 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
642642 (Intrinsic ' ' opNop)
643643 NoInterp
644644
645 runWith string dbgr =
646 let
647 initialState = State{ stack=(Stack []), interpreter=NoInterp, debugger=dbgr, getCh=getChar, putCh=putChar }
648 in
649 execute (Program string initialInterpreter) initialState
645 initialState = State{ stack=(Stack []), interpreter=NoInterp, debugger=nullDebugger, getCh=getChar, putCh=putChar }
646
647 runWith string state =
648 execute (Program string initialInterpreter) state
650649
651650 mascarpone string =
652 runWith string nullDebugger
651 runWith string initialState
652
653 mascarponeWithIO getCh putCh string =
654 runWith string initialState{ getCh=getCh, putCh=putCh }
653655
654656 debug string =
655 runWith string stdDebugger
657 runWith string initialState{ debugger=stdDebugger }
656658
657659
658660 -----------------------------------------------------------------------