Skip to content

Commit

Permalink
Print error messages on parsing issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
corywalker committed Aug 19, 2017
1 parent cb1c2c6 commit e35cac3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion expreduce/interp.go
Expand Up @@ -5,6 +5,7 @@ import (
"strings"
"go/token"
"os"
"fmt"
"log"
"bytes"
"github.com/cznic/wl"
Expand Down Expand Up @@ -345,10 +346,11 @@ func Interp(src string, es *EvalState) Ex {
// TODO(corywalker): use the interactive mode for proper newline handling.
in, err := wl.NewInput(buf, false)
if err != nil {
return &Symbol{"System`Null"}
panic(err)
}
expr, err := in.ParseExpression(token.NewFileSet().AddFile(os.Stdin.Name(), -1, 1e6))
if err != nil {
fmt.Printf("Syntax::sntx: %v.\n\n\n", err)
return &Symbol{"System`Null"}
}
parsed := ParserExprConv(expr)
Expand Down

0 comments on commit e35cac3

Please sign in to comment.