ó
Ä‚Œ\c           @  sq   d  d l  m Z d  d l j j Z d  d l Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d	 „  Z d S(
   iÿÿÿÿ(   t   print_functionNc         C  s“   t  j | | ƒ } xz t rŽ |  j d ƒ rH t |  j |  j ƒ ƒ | _ q |  j d ƒ ro |  j |  j ƒ | _	 q |  j d ƒ rŠ t | _
 q Pq W| S(   Nt   buttont   post   always(   t   testastt   Clickt   Truet   keywordt   intt   requiret   integerR   t   simple_expressiont   positionR   (   t   lt   loct   targett   rv(    (    sn   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\test\testparser.pyt   parse_click   s    	c         C  sr   t  j | | ƒ } xY t rm |  j d ƒ rB |  j |  j ƒ | _ q |  j d ƒ ri |  j |  j ƒ | _ q Pq W| S(   Nt   patternR   (	   R   t   TypeR   R   R	   t   stringR   R   R   (   R   R   t   keysR   (    (    sn   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\test\testparser.pyt
   parse_type0   s    	c         C  s]   t  j | ƒ } |  j |  j ƒ | _ x2 t rX |  j d ƒ rT |  j |  j ƒ | _ q' Pq' W| S(   NR   (	   R   t   MoveR	   R   R   R   R   R   R   (   R   R   R   (    (    sn   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\test\testparser.pyt
   parse_moveA   s    	c         C  s·   |  j  |  j ƒ } t j | | ƒ } xŒ t r² |  j d ƒ rZ t |  j  |  j ƒ ƒ | _ q' |  j d ƒ r |  j  |  j	 ƒ | _
 q' |  j d ƒ r® t |  j  |  j ƒ ƒ | _ q' Pq' W| S(   NR   R   t   steps(   R	   R   R   t   DragR   R   R   R
   R   R   R   R   (   R   R   t   pointsR   (    (    sn   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\test\testparser.pyt
   parse_dragQ   s    	c         C  s¼  |  j  d ƒ r1 |  j |  j ƒ } t j | | ƒ S|  j  d ƒ rb |  j |  j ƒ } t j | | ƒ S|  j  d ƒ r“ |  j |  j ƒ } t j | | ƒ S|  j  d ƒ rõ |  j ƒ  } | d  k	 rÍ t	 |  | | g ƒ S|  j |  j
 ƒ } t	 |  | t | ƒ ƒ S|  j  d ƒ rt |  | ƒ S|  j  d ƒ r-t |  | ƒ S|  j  d ƒ rLt |  | d  ƒ S|  j  d ƒ r}|  j |  j
 ƒ } t j | | ƒ S|  j
 ƒ  } | rŸt |  | | ƒ S|  j d	 ƒ t j | | ƒ S(
   Nt   runt   pauset   labelt   typet   dragt   movet   clickt   scrolls-   Expected a test language statement or clause.(   R   R	   R   R   t   Actiont   Pauset   namet   Labelt   NoneR   R   t   listR   R   R   t   Scrollt   errorR   (   R   R   t   exprR'   R   R   R   (    (    sn   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\test\testparser.pyt   parse_clauseg   s:    c   	      C  sì  |  j  d ƒ rZ |  j d ƒ |  j d ƒ |  j ƒ  } t j j | | ƒ } t j | | ƒ S|  j  d ƒ r½ |  j d ƒ t	 |  | ƒ } |  j d ƒ t
 |  j t ƒ | ƒ } t j | | | ƒ S|  j d ƒ |  j d ƒ r|  j |  j ƒ } t j j | | ƒ } t j | | ƒ S|  j  d ƒ rA|  j |  j ƒ } t j | | ƒ S|  j  d	 ƒ rr|  j |  j ƒ } t j | | ƒ S|  j  d
 ƒ r£|  j |  j ƒ } t j | | ƒ St	 |  | ƒ } |  j  d ƒ rèt	 |  | ƒ } t j | | | ƒ } n  | S(   Nt   pythont   :s   python blockt   ifs   if blockt	   statements   \$t   assertt   jumpt   callt   until(   R   R	   t   expect_blockt   python_blockt   renpyt   astt   PyCodeR   t   PythonR.   t   parse_blockt   subblock_lexert   Falset   Ift   expect_noblockt   matcht   restt   AssertR'   t   Jumpt   Callt   Until(	   R   R   t   sourcet   codet	   conditiont   blockR   R   t   right(    (    sn   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\test\testparser.pyt   parse_statement˜   s>    c         C  sU   g  } x< |  j  ƒ  rD t |  |  j ƒ  ƒ } | j | ƒ |  j ƒ  q	 Wt j | | ƒ S(   s6   
    Parses a named block of testcase statements.
    (   t   advanceRM   t   get_locationt   appendt
   expect_eolR   t   Block(   R   R   RK   t   stmt(    (    sn   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\test\testparser.pyR=   Î   s    (   t
   __future__R    t   renpy.test.testastt   testR   R9   R   R   R   R   R.   RM   R=   (    (    (    sn   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\test\testparser.pyt   <module>   s   					1	6