(source)
return '\n'.join(trailing_comments) + source
NOT USED: strips trailing comments and put them at the top.
NOT USED: strips trailing comments and put them at the top.
NOT USED : strips trailing comments and put them at the top .
def filtercomments(source):
    """NOT USED: strips trailing comments and put them at the top."""
    trailing_comments = []
    comment = True

    while comment:
        if re.search(r'^\s*\/\*', source):
            comment = source[0, source.index('*/') + 2]
        elif re.search(r'^\s*\/\/', source):
            comment = re.search(r'^\s*\/\/', source).group(0)
        else:
            comment = None

        if comment:
            source = re.sub(r'^\s+', '', source[len(comment):])
            trailing_comments.append(comment)

    return '\n'.join(trailing_comments) + source
def filtercomments ( source ) : trailing_comments = [ ] comment = True while comment : if re . search ( r'^\s*\/\*' , source ) : comment = source [ 0 , source . index ( '*/' ) + 2 ] elif re . search ( r'^\s*\/\/' , source ) : comment = re . search ( r'^\s*\/\/' , source ) . group ( 0 ) else : comment = None if comment : source = re . sub ( r'^\s+' , '' , source [ len ( comment ) : ] ) trailing_comments . append ( comment ) return '\n' . join ( trailing_comments ) + source