def find_column(t, pos=None):
    """
    Find the column of the token or a specific position in the token's data.

    Argument:
        t   - the token
        pos - an optional number indicating the position in the input data, if 
              not using the token's starting position
    """
    position = pos or t.lexpos  # position of the character in the input stream, default to the token's position
    last_cr = t.lexer.lexdata.rfind('\n', 0, position)
    if last_cr < 0:
        last_cr = 0
    column = (position - last_cr) + 1
    return column