Skip to content

Commit

Permalink
remove .repl
Browse files Browse the repository at this point in the history
  • Loading branch information
amirrezaask committed Oct 19, 2019
1 parent 91350a1 commit 473c7c6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.idea
.gshell
.repl
cover.profile
plans
3 changes: 0 additions & 3 deletions interpreter/.repl/sessions/605659000/go.mod

This file was deleted.

17 changes: 0 additions & 17 deletions interpreter/.repl/sessions/605659000/main.go

This file was deleted.

13 changes: 6 additions & 7 deletions interpreter/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,13 @@ func (s *Interpreter) Eval(code string) (string, error) {
return "", err
}
if s.continueMode {
return "", nil
}
if typ == Shell {
return "", nil
return strings.Repeat("...", s.indents), nil
}
if err := checkIfHasParsingError(s.String()); err != nil {
s.removeLastCode()
return "", errors.New(err.Error() + "\n")
if typ != Shell {
if err := checkIfHasParsingError(s.String()); err != nil {
s.removeLastCode()
return "", errors.New(err.Error() + "\n")
}
}
return s.eval(), nil
}
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var (
)

const (
version = "0.1.1a"
version = "0.1.2"
)

func completer(d prompt.Document) []prompt.Suggest {
Expand Down Expand Up @@ -64,7 +64,7 @@ func main() {
if err != nil {
panic(err)
}
fmt.Printf("gshell v%s\n", version)
fmt.Printf("repl v%s\n", version)

p := prompt.New(handler, completer, prompt.OptionPrefix("repl> "))
p.Run()
Expand Down

0 comments on commit 473c7c6

Please sign in to comment.