ó
šH—Vc           @   s^   d  d l  Z  d „  Z d d „ Z e d k rZ d  d l Z e e e j d ƒ j ƒ  ƒ GHn  d S(   iÿÿÿÿNc         C   s%   t  j d t  j ƒ } | j d |  ƒ S(   s<   remove all /* */ format comments and surrounding whitespace.s   [\s]*/\*.*?\*/[\s]*t    (   t   ret   compilet   DOTALLt   sub(   t   datat   p(    (    s   ../tools/minimize.pyt   strip_comments_helper   s    c         C   sb   x[ t  ƒ  j ƒ  D]J \ } } | j d ƒ r | d  } | sH | | k rZ | |  ƒ }  qZ q q W|  S(   sÿ   Central function call. This will call all other compression
       functions. To add further compression algorithms, simply add
       functions whose names end in _helper which take a string as input 
       and return a more compressed string as output.t   _helperiùÿÿÿ(   t   globalst	   iteritemst   endswith(   R   t   excludet   keyt   itemt   func_key(    (    s   ../tools/minimize.pyt   minimize!   s    
t   __main__i   (	   R   R   t   NoneR   t   __name__t   syst   opent   argvt   read(    (    (    s   ../tools/minimize.pyt   <module>   s
   	