def loc(parser, start):
    """Returns a location object, used to identify the place in
    the source that created a given parsed object."""
    if parser.options['no_location']:
        return None
    if parser.options['no_source']:
        return {
            'start': start,
            'end': parser.prev_end
        }
    return {
        'start': start,
        'end': parser.prev_end,
        'source': parser.source
    }