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() {
339
339
}
340
340
p .want (DONE )
341
341
case p .got (WORD ):
342
+ args:
342
343
for p .tok != EOF {
343
344
lval := p .val
344
345
switch {
@@ -355,29 +356,29 @@ func (p *parser) command() {
355
356
if p .got ('&' ) {
356
357
p .command ()
357
358
}
358
- return
359
+ break args
359
360
case p .got ('|' ):
360
361
p .got ('|' )
361
362
p .command ()
362
- return
363
+ break args
363
364
case p .got ('(' ):
364
365
if ! ident .MatchString (lval ) {
365
366
p .col -= utf8 .RuneCountInString (lval )
366
367
p .col --
367
368
p .lineErr ("invalid func name %q" , lval )
368
- return
369
+ break args
369
370
}
370
371
p .want (')' )
371
372
p .command ()
372
- return
373
+ break args
373
374
case p .got ('>' ):
374
375
p .redirectDest ()
375
376
case p .got ('<' ):
376
377
p .want (WORD )
377
378
case p .got (';' ):
378
- return
379
+ break args
379
380
case p .got ('\n' ):
380
- return
381
+ break args
381
382
default :
382
383
p .errAfterStr ("command" )
383
384
}
@@ -395,19 +396,15 @@ func (p *parser) command() {
395
396
if p .got ('&' ) {
396
397
p .command ()
397
398
}
398
- return
399
399
case p .got ('|' ):
400
400
p .got ('|' )
401
401
p .command ()
402
- return
403
402
case p .got ('>' ):
404
403
p .redirectDest ()
405
404
case p .got ('<' ):
406
405
p .want (WORD )
407
406
case p .got (';' ):
408
- return
409
407
case p .got ('\n' ):
410
- return
411
408
default :
412
409
p .errAfterStr ("block" )
413
410
}
You can’t perform that action at this time.
0 commit comments