def concatenate_files(filenames):
    """ Concatenate the specified files, adding `line directives so the lexer can track source locations.
    """
    contents = []
    for filename in filenames:
        contents.append('`line 1 "%s" 1' % filename)
        with open(filename, 'rb') as f:
            contents.append(f.read())

    return '\n'.join(contents)