code: def p_simple_list(p):
      '''simple_list : simple_list1
                     | simple_list1 AMPERSAND
                     | simple_list1 SEMICOLON'''
      tok = p.lexer
      heredoc.gatherheredocuments(tok)
  
      if len(p) == 3 or len(p[1]) > 1:
          parts = p[1]
          if len(p) == 3:
              parts.append(ast.node(kind='operator', op=p[2], pos=p.lexspan(2)))
          p[0] = ast.node(kind='list', parts=parts, pos=_partsspan(parts))
      else:
          assert len(p[1]) == 1
          p[0] = p[1][0]
  
      if (len(p) == 2 and p.lexer._parserstate & flags.parser.CMDSUBST and
              p.lexer._current_token.nopos() == p.lexer._shell_eof_token):
          # accept the input
          p.accept(f p_simple_list(p):
      '''simple_list : simple_list1
                     | simple_list1 AMPERSAND
                     | simple_list1 SEMICOLON'''
      tok = p.lexer
      heredoc.gatherheredocuments(tok)
  
      if len(p) == 3 or len(p[1]) > 1:
          parts = p[1]
          if len(p) == 3:
              parts.append(ast.node(kind='operator', op=p[2], pos=p.lexspan(2)))
          p[0] = ast.node(kind='list', parts=parts, pos=_partsspan(parts))
      else:
          assert len(p[1]) == 1
          p[0] = p[1][0]
  
      if (len(p) == 2 and p.lexer._parserstate & flags.parser.CMDSUBST and
              p.lexer._current_token.nopos() == p.lexer._shell_eof_token):
          # accept the input
          p.accept()
docs: simple_list : simple_list1
                     | simple_list1 AMPERSAND
                     | simple_list1 SEMICOLON