Skip to content

Commit

Permalink
Fixed parsing error on Go 1.19
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
  • Loading branch information
ajnavarro committed Jul 20, 2023
1 parent 07ce2aa commit 79b8800
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gnovm/pkg/repl/repl.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (r *Repl) Process(input string) (out string, err error) {
return r.handleDeclarations(decl)
}

return "", fmt.Errorf("error parsing code as expression (error: %w) and as declarations (error: %w)", expErr, declErr)
return "", fmt.Errorf("error parsing code:\n\t- as expression (error: %q)\n\t- as declarations (error: %q)", expErr.Error(), declErr.Error())
}

func (r *Repl) handleExpression(e *ast.File) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion gnovm/pkg/repl/repl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var fixtures = []struct {
},
{
Line: "var a := 1",
Error: "error parsing code as expression (error: error formatting code: 9:8: expected type, found ':=') and as declarations (error: error formatting code: 6:7: expected type, found ':=')",
Error: "error parsing code:\n\t- as expression (error: \"error formatting code: 9:8: expected type, found ':='\")\n\t- as declarations (error: \"error formatting code: 6:7: expected type, found ':='\")",
},
},
},
Expand Down

0 comments on commit 79b8800

Please sign in to comment.