Ńň
´ZHc        	   @   s¨   d  Z  d d k Z d d k Z d d k Z d d k Z d d k l Z l Z l Z d d k l Z l	 Z	 d d g Z
 e e Be BZ d e f d     YZ e d  Z d S(	   s"   Iterator based sre token scanner

i˙˙˙˙N(   t   VERBOSEt	   MULTILINEt   DOTALL(   t   BRANCHt
   SUBPATTERNt   Scannert   patternc           B   s#   e  Z e d   Z d d d  Z RS(   c   	      C   s  d  g |  _ t i   } | | _ g  } x t |  D] \ } } | i } y5 t i | t | d t i	 | |  f f g  } Wn t
 i j
 o
   n X| i |  |  i i |  q4 Wt |  d | _ t i | t d  | f f g  } t i |  |  _ d  S(   Ni   (   t   Nonet   actionst	   sre_parset   Patternt   flagst	   enumerateR   t
   SubPatternR   t   parset   sre_constantst   errort   appendt   lent   groupsR   t   sre_compilet   compilet   scanner(	   t   selft   lexiconR   t   st   pt   idxt   tokent   phraset
   subpattern(    (    s.   P:\graphics\Tools\Python26\lib\json\scanner.pyt   __init__   s"    	 		,!i    c         c   s  |  i  i  | |  i } |  i } | } t |  } xË t oĂ |   } | d j o Pn | i   \ }	 }
 | |
 j o Pn | | i } | d j	 o` | | |  \ } } | d j	 o/ | |
 j o" | }
 |  i  i  | |
  i } n | |
 f Vn |
 } q6 Wd S(   s-   Yield match, end_idx for each match

        N(   R   t   matchR   R   t   TrueR   t   spant	   lastindex(   R   t   stringR   t   contextR    R   t   lastendt   endt   mt
   matchbegint   matchendt   actiont   rvalt   next_pos(    (    s.   P:\graphics\Tools\Python26\lib\json\scanner.pyt   iterscan&   s(    	 	N(   t   __name__t
   __module__t   FLAGSR   R   R.   (    (    (    s.   P:\graphics\Tools\Python26\lib\json\scanner.pyR      s   c            s      f d   } | S(   Nc            s"     |  _  t i     |  _ |  S(   N(   R   t   reR   t   regex(   t   fn(   R   R   (    s.   P:\graphics\Tools\Python26\lib\json\scanner.pyt	   decoratorA   s    	(    (   R   R   R5   (    (   R   R   s.   P:\graphics\Tools\Python26\lib\json\scanner.pyR   @   s    (   t   __doc__R2   R	   R   R   R    R   R   R   R   t   __all__R1   t   objectR   R   (    (    (    s.   P:\graphics\Tools\Python26\lib\json\scanner.pyt   <module>   s   /