code: def p_inputunit(p):
      '''inputunit : simple_list simple_list_terminator
                   | NEWLINE
                   | error NEWLINE
                   | EOF'''
      # XXX
      if p.lexer._parserstate & flags.parser.CMDSUBST:
          p.lexer._parserstate.add(flags.parser.EOFTOKEN)
  
      if isinstance(p[1], ast.node):
          p[0] = p[1]
          # accept right here in case the input contains more lines that are
          # not part of the current command
          p.accept(f p_inputunit(p):
      '''inputunit : simple_list simple_list_terminator
                   | NEWLINE
                   | error NEWLINE
                   | EOF'''
      # XXX
      if p.lexer._parserstate & flags.parser.CMDSUBST:
          p.lexer._parserstate.add(flags.parser.EOFTOKEN)
  
      if isinstance(p[1], ast.node):
          p[0] = p[1]
          # accept right here in case the input contains more lines that are
          # not part of the current command
          p.accept()
docs: inputunit : simple_list simple_list_terminator
                   | NEWLINE
                   | error NEWLINE
                   | EOF