code: def p_command(p):
      '''command : simple_command
                 | shell_command
                 | shell_command redirection_list
                 | function_def
                 | coproc'''
      if isinstance(p[1], ast.node):
          p[0] = p[1]
          if len(p) == 3:
              assert p[0].kind == 'compound'
              p[0].redirects.extend(p[2])
              assert p[0].pos[0] < p[0].redirects[-1].pos[1]
              p[0].pos = (p[0].pos[0], p[0].redirects[-1].pos[1])
      else:
          p[0] = ast.node(kind='command', parts=p[1], pos=_partsspan(p[1])f p_command(p):
      '''command : simple_command
                 | shell_command
                 | shell_command redirection_list
                 | function_def
                 | coproc'''
      if isinstance(p[1], ast.node):
          p[0] = p[1]
          if len(p) == 3:
              assert p[0].kind == 'compound'
              p[0].redirects.extend(p[2])
              assert p[0].pos[0] < p[0].redirects[-1].pos[1]
              p[0].pos = (p[0].pos[0], p[0].redirects[-1].pos[1])
      else:
          p[0] = ast.node(kind='command', parts=p[1], pos=_partsspan(p[1]))
docs: command : simple_command
                 | shell_command
                 | shell_command redirection_list
                 | function_def
                 | coproc