summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2024-03-21 16:29:17 +0100
committerGitHub <noreply@github.com>2024-03-21 16:29:17 +0100
commitbf2d6438e95c60946c64a6692e3dae1d836364a6 (patch)
tree041f819cdeae47e3ed624dc2ce233cd2c1d143aa /main.go
parent5da3a651ba08859ccc1cdf1094603411696c8df2 (diff)
parent7a9ac73037f207e3895332e5ba2b30d465c9c339 (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.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.go b/main.go
index 5e0989b..f566510 100644
--- a/main.go
+++ b/main.go
@@ -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 = "", "> "