-í
ÆÄ =c      s'    d  Z    d k l Z  d Z  g  i Z e d d ƒ D ] Z e e e ƒ ƒ q? [ Z	  x9 e d D ]* Z
  e
 e	 j o  e	 i e
 ƒ n qo W d Ge	 GH d „  Z $ d „  Z - d	 „  Z 1 d
 „  Z 7 d „  Z ; d „  Z > d „  Z i d „  Z } e d j o ~ n d S(   sW   ParseString(s) -> LispList  is the function you want to use.
The rest?  Merely players.(   s
   generatorss    	
i    i   s   ()'s>   Parser.py: Legitimate characters to begin a lisp atom/symbol:
c   sJ       d } ! x& ! |  | | j o ! | d 7} q W" |  |  Sd S(   s7   Strips delimiters off the front, returns the new stringi    i   N(   s   is   ss   delims(   s   ss   delimss   i(    (    s   ./Parser.pys
   StripFront s   	  c   sŽ   $ % & d } ' xn |  D' ]c } ( | d j o ( | d 7} n= ) | d j o ) | d 8} n * | d j o * d Sn q W+ | Sd S(   s?   Returns how many right parens are needed to finish off the expri    s   (i   s   )s   ]N(   s   parenLvls   ss   c(   s   ss   cs   parenLvl(    (    s   ./Parser.pys
   ParenCount$ s   	
 	   c   sC   - . |  d d j o . |  Sn / |  d  d t |  d  ƒ Sd  S(   Niÿÿÿÿs   ]s   )(   s   ss
   ParenCount(   s   s(    (    s   ./Parser.pys   ReplaceSuperBracket- s    c   sV   1 2 3 t  |  ƒ }  4 t |  ƒ o t |  ƒ o 4 d Sn 5 t |  ƒ d j Sd S(   s>   DOes parenthesis checking, and runs IsLiteral and Quoted on iti    N(   s   ReplaceSuperBrackets   ss   IsLiteralLispLists   QuotedLispLists
   ParenCount(   s   s(    (    s   ./Parser.pys   WellformedLispList1 s
    c   s?   7 8 9 t  |  ƒ d j o |  d d j o |  d d j Sd S(   s/   Something like (1 2 3).  No quote at beginning.i   i    s   (iÿÿÿÿs   )]N(   s   lens   s(   s   s(    (    s   ./Parser.pys   IsLiteralLispList7 s   c   s?   ; < t  |  ƒ d j o" |  d d !d j o |  d d j Sd  S(   Ni   i    i   s   '(iÿÿÿÿs   )](   s   lens   s(   s   s(    (    s   ./Parser.pys   QuotedLispList; s   c   #sÒ  > @ A ‡ ‡  d †  } L t o t ˆ  ƒ p t ‚ M ˆ  d d !‰ P d } Q xyQ ˆ onS ˆ d t j o S t ˆ t ƒ n U ˆ d t	 j od V d } W x9 W | t ˆ ƒ j  o ˆ | t j o X | d 7} qª WY ˆ |  VZ ˆ | ‰ n˜ [ ˆ d d j o. \ | d d ƒ } ] ˆ |  V^ ˆ | ‰ nV _ ˆ d d !d j o. ` | d d ƒ } a ˆ |  Vb ˆ | ‰ n d t d	 ˆ ‚ f x- f ˆ o ˆ d t j o g ˆ d ‰ qœWqU Wd
 S(   sQ   Give this sucker an UNQUOTED lisp-string.
    Generates strings and only strings.c   s  A B t  o d t ƒ  j p t ‚ C x¡ C |  t ˆ  ƒ j  o
 | d j o} D ˆ  |  d j o D | d 7} nH E ˆ  |  d j o E | d 8} n# F t  o ˆ  |  d j p t ‚ G |  d 7}  q* WH t  o/ |  t ˆ  ƒ j o
 | d j p t d ˆ ‚ I |  Sd  S(   Ns
   curListStri    s   (i   s   )s   ]s;   Parenthesis Mismatch error!  (Big surprise forLISP). For %s(   s	   __debug__s   localss   AssertionErrors   is   lens
   curListStrs   curParenDepths   lispLiteral(   s   is   curParenDepth(   s
   curListStrs   lispLiteral(    s   ./Parser.pys   _GotoMatchingParenA s   ! #  "9i   iÿÿÿÿs    i    s   (i   s   '(s   Dunno what to do with '%s'N(   s   _GotoMatchingParens	   __debug__s   IsLiteralLispLists   lispLiterals   AssertionErrors
   curListStrs   elems   DELIMSs
   StripFronts   SYMBOL_STARTERSs   is   lens   matchingPoss	   Exception(   s   lispLiterals
   curListStrs   _GotoMatchingParens   is   elems   matchingPos(    (   s   lispLiterals
   curListStrs   ./Parser.pys   ParseElemsGen> s8   	 
 	 ' c   s›   i j k d „  } s t o t |  ƒ p t ‚ u t |  ƒ }  v t |  ƒ o, w |  d } x d t | | ƒ ƒ g } n z t | |  ƒ ƒ } { | Sd S(   sP   lispListStr can either be quoted or unquoted.  Prepends the quote macro and all.c   #sL   k l x? t  |  ƒ Dl ]. } p t | ƒ o p t | ƒ Vn q | Vq Wd  S(   N(   s   ParseElemsGens   ss   elems   WellformedLispLists   ParseString(   s   ss   elem(    (    s   ./Parser.pys	   HelperGenk s
    	 i   s   quoteN(
   s	   HelperGens	   __debug__s   WellformedLispLists   lispListStrs   AssertionErrors   ReplaceSuperBrackets   QuotedLispLists   notQuotedParts   lists   ret(   s   lispListStrs	   HelperGens   notQuotedParts   ret(    (    s   ./Parser.pys   ParseStringi s   s   __main__N(   s   __doc__s
   __future__s
   generatorss   DELIMSs   appends   _[1]s   ranges   xs   chrs   SYMBOL_STARTERSs   not_a_starters   removes
   StripFronts
   ParenCounts   ReplaceSuperBrackets   WellformedLispLists   IsLiteralLispLists   QuotedLispLists   ParseElemsGens   ParseStrings   __name__(   s
   StripFronts   ParseElemsGens   ParseStrings   WellformedLispLists   not_a_starters   SYMBOL_STARTERSs   DELIMSs   _[1]s
   ParenCounts
   generatorss   IsLiteralLispLists   xs   QuotedLispLists   ReplaceSuperBracket(    (    s   ./Parser.pys   ? s&   	 " 		+