File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -339,6 +339,7 @@ func (p *parser) command() {
339339 }
340340 p .want (DONE )
341341 case p .got (WORD ):
342+ args:
342343 for p .tok != EOF {
343344 lval := p .val
344345 switch {
@@ -355,29 +356,29 @@ func (p *parser) command() {
355356 if p .got ('&' ) {
356357 p .command ()
357358 }
358- return
359+ break args
359360 case p .got ('|' ):
360361 p .got ('|' )
361362 p .command ()
362- return
363+ break args
363364 case p .got ('(' ):
364365 if ! ident .MatchString (lval ) {
365366 p .col -= utf8 .RuneCountInString (lval )
366367 p .col --
367368 p .lineErr ("invalid func name %q" , lval )
368- return
369+ break args
369370 }
370371 p .want (')' )
371372 p .command ()
372- return
373+ break args
373374 case p .got ('>' ):
374375 p .redirectDest ()
375376 case p .got ('<' ):
376377 p .want (WORD )
377378 case p .got (';' ):
378- return
379+ break args
379380 case p .got ('\n' ):
380- return
381+ break args
381382 default :
382383 p .errAfterStr ("command" )
383384 }
@@ -395,19 +396,15 @@ func (p *parser) command() {
395396 if p .got ('&' ) {
396397 p .command ()
397398 }
398- return
399399 case p .got ('|' ):
400400 p .got ('|' )
401401 p .command ()
402- return
403402 case p .got ('>' ):
404403 p .redirectDest ()
405404 case p .got ('<' ):
406405 p .want (WORD )
407406 case p .got (';' ):
408- return
409407 case p .got ('\n' ):
410- return
411408 default :
412409 p .errAfterStr ("block" )
413410 }
You can’t perform that action at this time.
0 commit comments