import re


def __strip_readability(source):
    """ Strip readability characters from the source
    :param source: The source GLSL string
    :return: The GLSL string without readability characters
    """

    # Remove all redundant newlines
    source = re.sub(re.compile(r'(?<!#version 100)\\n'), ' ', source)

    # Remove all non essential tabs and spaces
    return re.sub(re.compile(r'(?<!\s)((?<=[\W])\s+|\s+(?=[\W]))'), '', source)