mirror of
https://github.com/kanaka/mal.git
synced 2024-10-26 22:28:26 +03:00
vbs: rewrite step4 using IOWrap
This commit is contained in:
parent
176eca9c6a
commit
6e33dc8c3f
@ -1,5 +1,6 @@
|
||||
Option Explicit
|
||||
|
||||
Include "IO.vbs"
|
||||
Include "Types.vbs"
|
||||
Include "Reader.vbs"
|
||||
Include "Printer.vbs"
|
||||
@ -117,10 +118,10 @@ Call REPL()
|
||||
Sub REPL()
|
||||
Dim strCode, strResult
|
||||
While True
|
||||
WScript.StdOut.Write "user> "
|
||||
IO.Write "user> "
|
||||
|
||||
On Error Resume Next
|
||||
strCode = WScript.StdIn.ReadLine()
|
||||
strCode = IO.ReadLine
|
||||
If Err.Number <> 0 Then WScript.Quit 0
|
||||
On Error Goto 0
|
||||
|
||||
@ -128,11 +129,10 @@ Sub REPL()
|
||||
On Error Resume Next
|
||||
strRes = REP(strCode)
|
||||
If Err.Number <> 0 Then
|
||||
'WScript.StdOut.WriteLine Err.Source + ": " + Err.Description
|
||||
WScript.StdOut.WriteLine "Exception: " + Err.Description
|
||||
IO.WriteErrLine "Exception: " + Err.Description
|
||||
Else
|
||||
If strRes <> "" Then
|
||||
WScript.Echo strRes
|
||||
IO.WriteLine strRes
|
||||
End If
|
||||
End If
|
||||
On Error Goto 0
|
||||
|
Loading…
Reference in New Issue
Block a user