;ò
½0sDc           @   s  d  Z  d Z d k Z d k Z d k Z d „  Z d d d d d d	 d
 d d d d d d d d d d d d d d d d d d d d d d  d! g Z d" Z d# Z e e d$ d% ƒ d& e e d$ d' ƒ Z d( Z e i	 e i
 e ƒ d) ƒ Z e e d$ d% ƒ d& e e d$ d' ƒ Z d* Z e d+ e i	 e d& ƒ d, e Z e d& e d& e d& e Z e i e ƒ Z d- Z e i e ƒ Z d. e d/ „ Z d0 „  Z d S(1   sc  Module to analyze Python source code; for syntax coloring tools.

Interface:
    tags = fontify(pytext, searchfrom, searchto)

The 'pytext' argument is a string containing Python source code.
The (optional) arguments 'searchfrom' and 'searchto' may contain a slice in pytext.
The returned value is a list of tuples, formatted like this:
    [('keyword', 0, 6, None), ('keyword', 11, 17, None), ('comment', 23, 53, None), etc. ]
The tuple contents are always like this:
    (tag, startindex, endindex, sublist)
tag is one of 'keyword', 'string', 'comment' or 'identifier'
sublist is not used, hence always None.
s   0.4Nc         C   s    t  i t  i |  | ƒ | ƒ Sd  S(   N(   s   strings   joins   splits   wheres   whats   with(   s   wheres   whats   with(    (    sA   /home/packages/reportlab/reportlab_2_0/reportlab/lib/PyFontify.pys   replace#   s    s   ass   asserts   execs   dels   froms   lambdas   returns   ands   elifs   globals   nots   trys   breaks   elses   ifs   ors   whiles   classs   excepts   imports   passs   continues   finallys   ins   prints   defs   fors   iss   raises   yields   #[^\n]*s$   q[^\\q\n]*(\\[\000-\377][^\\q\n]*)*qs   qs   's   |s   "s  
    qqq
    [^\\q]*
    (
        (   \\[\000-\377]
        |   q
            (   \\[\000-\377]
            |   [^\q]
            |   q
                (   \\[\000-\377]
                |   [^\\q]
                )
            )
        )
        [^\\q]*
    )*
    qqq
s    s   (^|[^a-zA-Z0-9_.\"'])s   (s   )s   [ 	]*[A-Za-z_][A-Za-z_0-9.]*i    c         C   s
  | t j o t |  ƒ } n t i } t i } g  } | i	 } d } d } d } d } d }	 | } xn o•| |  | ƒ } | t j o Pn | i ƒ  }	 |	 | j o Pn | i d ƒ }
 |	 t |
 ƒ } |
 d } | d j oß |	 | j o |
 d d !}
 |	 d }	 n |
 d  }
 | d } | | |	 | t f ƒ |
 d	 d
 g j ov | |  | ƒ } | t j	 oV | i ƒ  }	 |	 | j o9 | i d ƒ }
 |	 t |
 ƒ } | | |	 | t f ƒ q¸q¼qýqe | d j o | | |	 | t f ƒ qe | | |	 | t f ƒ ql W| Sd  S(   Ns   comments   strings   keywords
   identifieri    i   s   #'"iÿÿÿÿs   defs   classs   #(   s   searchtos   Nones   lens   pytexts   matchREs   searchs   idREs   idSearchs   tagss   appends   tags_appends
   commentTags	   stringTags
   keywordTags   identifierTags   starts
   searchfroms   ends   ms   groups   matchs   c(   s   pytexts
   searchfroms   searchtos
   keywordTags   searchs   idSearchs   ends   tagss	   stringTags   starts   matchs   identifierTags   cs
   commentTags   tags_appends   m(    (    sA   /home/packages/reportlab/reportlab_2_0/reportlab/lib/PyFontify.pys   fontify^   sT    			 


&c         C   s`   t  |  ƒ } | i ƒ  } | i ƒ  t | ƒ } x+ | D]# \ } } } } | G| | | !GHq5 Wd  S(   N(   s   opens   paths   fs   reads   texts   closes   fontifys   tagss   tags   starts   ends   sublist(   s   paths   ends   tagss   texts   fs   sublists   starts   tag(    (    sA   /home/packages/reportlab/reportlab_2_0/reportlab/lib/PyFontify.pys   test•   s    
 (   s   __doc__s   __version__s   strings   res   replaces   keywordsLists
   commentPats   pats   quotePats   joins   splits   tripleQuotePats	   nonKeyPats   keyPats   matchPats   compiles   matchREs   idKeyPats   idREs   Nones   fontifys   test(   s   idKeyPats   fontifys   matchREs   pats   strings   quotePats   idREs   replaces	   nonKeyPats   res
   commentPats   keyPats   tests   keywordsLists   matchPats   __version__s   tripleQuotePat(    (    sA   /home/packages/reportlab/reportlab_2_0/reportlab/lib/PyFontify.pys   ?   s(   				`&&"7