mirror of
https://github.com/kanaka/mal.git
synced 2024-10-27 06:40:14 +03:00
40 lines
700 B
Plaintext
40 lines
700 B
Plaintext
Option Explicit
|
|
|
|
Include "IO.vbs"
|
|
|
|
Function Read(strCode)
|
|
Read = strCode
|
|
End Function
|
|
|
|
Function Evaluate(strCode)
|
|
Evaluate = strCode
|
|
End Function
|
|
|
|
Function Print(strCode)
|
|
Print = strCode
|
|
End Function
|
|
|
|
Function REP(strCode)
|
|
REP = Print(Evaluate(Read(strCode)))
|
|
End Function
|
|
|
|
Dim strCode
|
|
While True 'REPL
|
|
WScript.StdOut.Write "user> "
|
|
On Error Resume Next
|
|
strCode = IO.ReadLine
|
|
If Err.Number <> 0 Then WScript.Quit 0
|
|
On Error Goto 0
|
|
|
|
IO.WriteLine REP(strCode)
|
|
Wend
|
|
|
|
|
|
Sub Include(strFileName)
|
|
With CreateObject("Scripting.FileSystemObject")
|
|
ExecuteGlobal .OpenTextFile( _
|
|
.GetParentFolderName( _
|
|
.GetFile(WScript.ScriptFullName)) & _
|
|
"\" & strFileName).ReadAll
|
|
End With
|
|
End Sub |