def p_pipeline_command(p):
    '''pipeline_command : pipeline
                        | BANG pipeline_command
                        | timespec pipeline_command
                        | timespec list_terminator
                        | BANG list_terminator'''
    if len(p) == 2:
        if len(p[1]) == 1:
            p[0] = p[1][0]
        else:
            p[0] = ast.node(kind='pipeline', parts=p[1],
                            pos=(p[1][0].pos[0], p[1][-1].pos[1]))
    else:
        # XXX timespec
        node = ast.node(kind='reservedword', word='!', pos=p.lexspan(1))
        if p[2].kind == 'pipeline':
            p[0] = p[2]
            p[0].parts.insert(0, node)
            p[0].pos = (p[0].parts[0].pos[0], p[0].parts[-1].pos[1])
        else:
            p[0] = ast.node(kind='pipeline', parts=[node, p[2]],
                            pos=(node.pos[0], p[2].pos[1]))
def p_pipeline_command ( p ) : if len ( p ) == 2 : if len ( p [ 1 ] ) == 1 : p [ 0 ] = p [ 1 ] [ 0 ] else : p [ 0 ] = ast . node ( kind = 'pipeline' , parts = p [ 1 ] , pos = ( p [ 1 ] [ 0 ] . pos [ 0 ] , p [ 1 ] [ - 1 ] . pos [ 1 ] ) ) else : node = ast . node ( kind = 'reservedword' , word = '!' , pos = p . lexspan ( 1 ) ) if p [ 2 ] . kind == 'pipeline' : p [ 0 ] = p [ 2 ] p [ 0 ] . parts . insert ( 0 , node ) p [ 0 ] . pos = ( p [ 0 ] . parts [ 0 ] . pos [ 0 ] , p [ 0 ] . parts [ - 1 ] . pos [ 1 ] ) else : p [ 0 ] = ast . node ( kind = 'pipeline' , parts = [ node , p [ 2 ] ] , pos = ( node . pos [ 0 ] , p [ 2 ] . pos [ 1 ] ) )
pipeline_command : pipeline
                        | BANG pipeline_command
                        | timespec pipeline_command
                        | timespec list_terminator
                        | BANG list_terminator