diff options
| author | Marc Vertes <mvertes@free.fr> | 2024-03-21 16:29:17 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-21 16:29:17 +0100 |
| commit | bf2d6438e95c60946c64a6692e3dae1d836364a6 (patch) | |
| tree | 041f819cdeae47e3ed624dc2ce233cd2c1d143aa /main.go | |
| parent | 5da3a651ba08859ccc1cdf1094603411696c8df2 (diff) | |
| parent | 7a9ac73037f207e3895332e5ba2b30d465c9c339 (diff) | |
Merge pull request #7 from ajnavarro/feature/simple-memory-dump
feat: Add simple Dump creation and recovery.
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -8,6 +8,7 @@ import ( "io" "log" "os" + "reflect" "github.com/mvertes/parscan/lang/golang" "github.com/mvertes/parscan/parser" @@ -15,7 +16,7 @@ import ( ) type Interpreter interface { - Eval(string) (any, error) + Eval(string) (reflect.Value, error) } func main() { @@ -44,7 +45,7 @@ func repl(interp Interpreter, in io.Reader) (err error) { text += liner.Text() res, err := interp.Eval(text + "\n") if err == nil { - if res != nil { + if !res.IsNil() { fmt.Println(": ", res) } text, prompt = "", "> " |
