diff options
author | Adam Scarr <adam@vektah.net> | 2017-08-13 16:56:12 +1000 |
---|---|---|
committer | Adam Scarr <adam@vektah.net> | 2017-08-13 16:56:12 +1000 |
commit | 0dc37ae5bc10cc0669f88ab9febbc039a28f23d1 (patch) | |
tree | 0395aac5ab5223a4390eb03b22455ed3c98b6c90 /parser.go | |
parent | f633909141dc1e2c2e49b94e5e478e99be51a9cb (diff) |
Remove a few allocs from Run
Diffstat (limited to 'parser.go')
-rw-r--r-- | parser.go | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,7 +1,6 @@ package goparsify import ( - "errors" "fmt" "regexp" "strings" @@ -90,11 +89,11 @@ func Run(parser Parserish, input string, ws ...VoidParser) (result interface{}, ps.AutoWS() if ps.Error.expected != "" { - return ret.Result, ps.Error + return ret.Result, &ps.Error } if ps.Get() != "" { - return ret.Result, errors.New("left unparsed: " + ps.Get()) + return ret.Result, UnparsedInputError{ps.Get()} } return ret.Result, nil |