Ñò

þPc           @  s  d  d k  l Z d  d k Z d  d k Z d „  Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d	 „  ƒ  YZ d
 „  Z	 d „  Z
 d „  Z e d j od d  d k Z e ƒ  Z e i e ƒ e d i d ƒ d d d d g e d <d e d <e i e ƒ n d S(   iÿÿÿÿ(   t   print_functionNc           s   ‡  f d †  } | S(   Nc            sO   t  i  ƒ  } ˆ  |  Œ  } t  i  ƒ  } t d i d ˆ  i d | | d ƒ ƒ | S(   Ns   {name} took {time:0.3f} mst   namet   timeg     @@(   R   t   printt   formatt   __name__(   t   argt   t1t   rest   t2(   t   func(    sL   /home/stack/.vim/addons/TagHighlight/plugin/TagHighlight/module/utilities.pyt   wrapper   s
    '(    (   R
   R   (    (   R
   sL   /home/stack/.vim/addons/TagHighlight/plugin/TagHighlight/module/utilities.pyt   print_timing   s    t   TagHighlightOptionDictc           B  s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   sC   Customised version of a dictionary that allows access by attribute.c         C  s   |  | S(   N(    (   t   selfR   (    (    sL   /home/stack/.vim/addons/TagHighlight/plugin/TagHighlight/module/utilities.pyt   __getattr__    s    c         C  sh   | |  j oE d d k  l } x2 | i ƒ  D]  } | | j o | | d Sq* Wn t t |  ƒ i | ƒ S(   Ni   (   t
   AllOptionst   Default(   t   optionsR   t   keyst   superR   t   __getitem__(   R   R   R   t   option(    (    sL   /home/stack/.vim/addons/TagHighlight/plugin/TagHighlight/module/utilities.pyR   #   s     c         C  s   | |  | <d  S(   N(    (   R   R   t   value(    (    sL   /home/stack/.vim/addons/TagHighlight/plugin/TagHighlight/module/utilities.pyt   __setattr__+   s    (   R   t
   __module__t   __doc__R   R   R   (    (    (    sL   /home/stack/.vim/addons/TagHighlight/plugin/TagHighlight/module/utilities.pyR      s   		t   SetDictc           B  s    e  Z d  Z d „  Z d „  Z RS(   sO   Customised version of a dictionary that auto-creates non-existent keys as sets.c         C  s4   | |  j o t  ƒ  |  | <n t t |  ƒ i | ƒ S(   N(   t   setR   R   R   (   R   t   key(    (    sL   /home/stack/.vim/addons/TagHighlight/plugin/TagHighlight/module/utilities.pyR   0   s    c         C  sS   t  | t ƒ o t t |  ƒ i | | ƒ n# t t |  ƒ i | t | g ƒ ƒ d  S(   N(   t
   isinstanceR   R   R   t   __setitem__(   R   R   R   (    (    sL   /home/stack/.vim/addons/TagHighlight/plugin/TagHighlight/module/utilities.pyR   5   s    (   R   R   R   R   R   (    (    (    sL   /home/stack/.vim/addons/TagHighlight/plugin/TagHighlight/module/utilities.pyR   .   s   	t   DictDictc           B  s    e  Z d  Z d „  Z d „  Z RS(   sS   Customised version of a dictionary that auto-creates non-existent keys as SetDicts.c         C  s4   | |  j o t  ƒ  |  | <n t t |  ƒ i | ƒ S(   N(   R   R   R    R   (   R   R   (    (    sL   /home/stack/.vim/addons/TagHighlight/plugin/TagHighlight/module/utilities.pyR   =   s    c         C  s7   t  | t ƒ o t t |  ƒ i | | ƒ n t ‚ d  S(   N(   R   R   R   R    R   t   NotImplementedError(   R   R   R   (    (    sL   /home/stack/.vim/addons/TagHighlight/plugin/TagHighlight/module/utilities.pyR   B   s    (   R   R   R   R   R   (    (    (    sL   /home/stack/.vim/addons/TagHighlight/plugin/TagHighlight/module/utilities.pyR    ;   s   	c         C  sI  |  i  d ƒ } t i d ƒ } t i d ƒ } g  } x| D]} | i | ƒ } | i | ƒ } | d j o] xÓg  } t d d ƒ D] }	 | t |	 ƒ q‚ ~ D]$ }
 |
 i ƒ  o | i |
 ƒ qœ qœ Wq: | d  j	 o| i	 d ƒ i
 ƒ  o t | i	 d ƒ ƒ } n t | i	 d ƒ ƒ } | i	 d ƒ i
 ƒ  o t | i	 d ƒ ƒ } n t | i	 d ƒ ƒ } t t | | d	 ƒ ƒ } g  } | D] }	 |	 d j  o | |	 qq~ } x–g  } | D] }	 | t |	 ƒ q¶~ D] }
 | i |
 ƒ qÐWq: | d  j	 oþ | i	 d ƒ i
 ƒ  o t | i	 d ƒ ƒ } n t | i	 d ƒ ƒ } | i	 d ƒ i
 ƒ  o t | i	 d ƒ ƒ } n t | i	 d ƒ ƒ } t | | d	 ƒ } x« g  } | D] }	 | t |	 ƒ q¡~ D]3 }
 x* t | i |
 ƒ ƒ D] }	 | i |
 ƒ q×Wq»Wq: t | ƒ d	 j o( t | ƒ d j  o | i | ƒ qAq: t d
 | ƒ ‚ q: W| S(   Nt   ,s)   ^(?P<from>(?:\d+|\S))-(?P<to>(?:\d+|\S))$s*   ^^(?P<from>(?:\d+|\S))-(?P<to>(?:\d+|\S))$t   @i    i€   t   fromt   toi   s   Unrecognised iskeyword part: (   t   splitt   ret   compilet   matcht   ranget   chrt   isalphat   appendt   Nonet   groupt   isdigitt   intt   ordt   listt   countt   removet   lent
   ValueError(   t	   iskeywordt   ValidKeywordSetst   rangeMatchert   falseRangeMatchert	   validListt   validt   mt   fmt   _[1]t   it   cht	   rangeFromt   rangeTot
   validRanget   _[2]t   _[3]t   _[4](    (    sL   /home/stack/.vim/addons/TagHighlight/plugin/TagHighlight/module/utilities.pyt   GenerateValidKeywordRangeH   sV     1 2( (  c         C  s'   x  |  D] } | | j o t  Sq Wt S(   N(   t   Falset   True(   t   keywordR8   t   char(    (    sL   /home/stack/.vim/addons/TagHighlight/plugin/TagHighlight/module/utilities.pyt   IsValidKeyword„   s
     	c   
   
   C  s…   d d  k  } d d  k } g  } x` | i |  ƒ D]O \ } } } | g  } | i | | ƒ D] }	 | | i i | |	 ƒ qW ~ 7} q. W| S(   Niÿÿÿÿ(   t   ost   fnmatcht   walkt   filtert   patht   join(
   RS   t   patternRO   RP   t   matchest   roott   dirnamest	   filenamesR@   RA   (    (    sL   /home/stack/.vim/addons/TagHighlight/plugin/TagHighlight/module/utilities.pyt   rglobŠ   s     Dt   __main__t   MyIndext   Hellot   Thist   Ist   At   Listt   SetLists   This is a stringt	   SetString(   t
   __future__R    R   R'   R   t   dictR   R   R    RI   RN   RZ   R   t   pprintt   test_objt   add(    (    (    sL   /home/stack/.vim/addons/TagHighlight/plugin/TagHighlight/module/utilities.pyt   <module>   s"   			<				
