Skip to content

Commit

Permalink
trim input
Browse files Browse the repository at this point in the history
  • Loading branch information
geremachek committed Oct 5, 2021
1 parent 18bed2d commit a724336
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions stack/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ func (s *Stack) parseCommand(c cmd.Command) (err error) {
// value... command... error? Deal with them all!

func (s *Stack) Parse(input string) error {
if v, e := parseValue(input); e == nil {
trimmed := strings.Trim(input, " ")

if v, e := parseValue(trimmed); e == nil {
s.push(v)
} else if c, e := cmd.NewCommand(input); e == nil {
} else if c, e := cmd.NewCommand(trimmed); e == nil {
return s.parseCommand(c)
} else {
return e
Expand Down

0 comments on commit a724336

Please sign in to comment.