
xi\c           @   s%  d  Z  d d l Z d d l m Z m Z m Z m Z m Z m Z m	 Z	 m
 Z
 d d l m Z m Z m Z m Z m Z m Z m Z m Z m Z d d l m Z m Z d d d d	 g Z d
   Z d e e  f d     YZ d e e  f d     YZ d e f d     YZ d	 e f d     YZ d S(   s   
    pygments.lexers.objective
    ~~~~~~~~~~~~~~~~~~~~~~~~~

    Lexers for Objective-C family languages.

    :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
iN(   t
   RegexLexert   includet   bygroupst   usingt   thist   wordst   inheritt   default(	   t   Textt   Keywordt   Namet   Stringt   Operatort   Numbert   Punctuationt   Literalt   Comment(   t   CLexert   CppLexert   ObjectiveCLexert   ObjectiveCppLexert
   LogosLexert
   SwiftLexerc            sD   t  j d    t  j d   d  f     f d     Y} | S(   s^   
    Generate a subclass of baselexer that accepts the Objective-C syntax
    extensions.
    s    @(?:end|implementation|protocol)s<   \[\s*[a-zA-Z_]\w*\s+(?:[a-zA-Z_]\w*\s*\]|(?:[a-zA-Z_]\w*)?:)t   GeneratedObjectiveCVariantc        7      s  e  Z d  Z i d e d f d e f d e j f d e j f d e j f d e j f d e j f d	 e j	 f d
 e
 d f d e
 d f d e
 d f e do d: d; e f e dp d: d; e j f dE e j f dF e j f dG e j f dH e j f dI e e e  dq f dL e e e  dr f dN e f e g dO 6dP e e j e e j e e  ds f dR e e j e e j  dJ f dS e e j e e j e e  dt f dT e e j e e j  dJ f dU e e j e e  du f dV e j dJ f g dK 6dW e e j e  dM f dX e e j e  dJ f g dM 6e dY  e dO  dZ e f d[ e d\ f d] e dJ f g dQ 6d^ e e e e e  e e j  d_ f e g d` 6e dY  da e f db e f dc e e e  e e j  f dd e j f dZ e dJ f d[ e de f e dJ  g d_ 6df e dg f dh e
 dJ f e di  g d 6df e d\ f dh e dJ f e di  g dg 6dj e dk f dl e
 dJ f e di  g d 6dj e d\ f dl e dJ f e di  g dk 6d] e
 dJ f e di  g d 6Z    f dm   Z  f dn   Z RS(v   sU   
        Implements Objective-C syntax on top of an existing C family lexer.
        s   @"t   strings	   @(YES|NO)s3   @'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'s&   @(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?s   @(\d+\.\d*|\.\d+|\d+[fF])[fF]?s   @0x[0-9a-fA-F]+[Ll]?s   @0[0-7]+[Ll]?s	   @\d+[Ll]?s   @\(t   literal_numbers   @\[t   literal_arrays   @\{t   literal_dictionarys	   @selectors   @privates
   @protecteds   @publics   @encodes   @synchronizeds   @trys   @throws   @catchs   @finallys   @ends	   @propertys   @synthesizet   __bridget   __bridge_transfert   __autoreleasingt   __blockt   __weakt   __strongt   weakt   strongt   copyt   retaint   assignt   unsafe_unretainedt   atomict	   nonatomict   readonlyt	   readwritet   settert   gettert   typeoft   int   outt   inoutt   releaset   classs   @dynamics	   @optionals	   @requireds   @autoreleasepools   @importt   suffixs   \bt   idt   instancetypet   Classt   IMPt   SELt   BOOLt   IBOutlett   IBActiont   unichars   @(true|false|YES|NO)\ns   (YES|NO|nil|self|super)\bs3   (Boolean|UInt8|SInt8|UInt16|SInt16|UInt32|SInt32)\bs   (TRUE|FALSE)\bs!   (@interface|@implementation)(\s+)s   #popt   oc_classnames   (@class|@protocol)(\s+)t   oc_forward_classnamet   @t
   statementss7   ([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?(\s*)(\{)t   oc_ivarss.   ([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?s6   ([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))(\s*)(\{)s-   ([a-zA-Z$_][\w$]*)(\s*)(\([a-zA-Z$_][\w$]*\))s   ([a-zA-Z$_][\w$]*)(\s*)(\{)s   ([a-zA-Z$_][\w$]*)s   ([a-zA-Z$_][\w$]*)(\s*,\s*)s   ([a-zA-Z$_][\w$]*)(\s*;?)t
   whitespacet   ;s   \{s   #pushs   \}s/   ^([-+])(\s*)(\(.*?\))?(\s*)([a-zA-Z$_][\w$]*:?)t   methodt   roott   ,s   \.\.\.s    (\(.*?\))(\s*)([a-zA-Z$_][\w$]*)s   [a-zA-Z$_][\w$]*:t   functions   \(t   literal_number_inners   \)t	   statements   \[t   literal_array_inners   \]c            sP     j  |   r d Sd |  k r# d St j  d |   r9 d S j  |   rL d Sd S(   Ng      ?s   @"g?s   @[0-9]+gffffff?i    (   t   searcht   re(   t   text(   t   _oc_keywordst   _oc_message(    s8   lib/python2.7/site-packages/pygments/lexers/objective.pyt   analyse_text   s    c         3   s   d d l  m } m } m } x   j |  |  D]n \ } } } | t k sY | t j k r | | k s} | | k s} | | k r t j j } q n  | | | f Vq/ Wd  S(   Ni(   t   COCOA_INTERFACESt   COCOA_PROTOCOLSt   COCOA_PRIMITIVES(	   t   pygments.lexers._cocoa_builtinsRR   RS   RT   t   get_tokens_unprocessedR
   R7   t   Builtint   Pseudo(   t   selfRN   RR   RS   RT   t   indext   tokent   value(   t	   baselexer(    s8   lib/python2.7/site-packages/pygments/lexers/objective.pyRV      s    (*   s	   @selectors   @privates
   @protecteds   @publics   @encodes   @synchronizeds   @trys   @throws   @catchs   @finallys   @ends	   @propertys   @synthesizeR   R   R   R   R    R!   R"   R#   R$   R%   R&   R'   R(   R)   R*   R+   R,   R-   R.   R/   R0   R1   R2   R3   s   @dynamics	   @optionals	   @requireds   @autoreleasepools   @import(	   R5   R6   R7   R8   R9   R:   R;   R<   R=   (   s   #popR>   (   s   #popR?   (   s   #popRB   (   s   #popRB   (   s   #popRB   (   t   __name__t
   __module__t   __doc__R   R   t   Chart   Floatt   Hext   Octt   IntegerR   R   R	   t   TypeR
   RW   R   R   R   R   R7   t   LabelR   R   R   t   Functiont   VariableR   t   tokensRQ   RV   (    (   RO   RP   R]   (    s8   lib/python2.7/site-packages/pygments/lexers/objective.pyR   +   s   	       		
			
			(   RM   t   compile(   R]   R   (    (   RO   RP   R]   s8   lib/python2.7/site-packages/pygments/lexers/objective.pyt	   objective   s    "c           B   sA   e  Z d  Z d Z d d d d g Z d d g Z d g Z d	 Z RS(
   sC   
    For Objective-C source code with preprocessor directives.
    s   Objective-Cs   objective-ct
   objectivecs   obj-ct   objcs   *.ms   *.hs   text/x-objective-cg?(   R^   R_   R`   t   namet   aliasest	   filenamest	   mimetypest   priority(    (    (    s8   lib/python2.7/site-packages/pygments/lexers/objective.pyR      s   	c           B   sA   e  Z d  Z d Z d d d d g Z d d g Z d g Z d	 Z RS(
   sE   
    For Objective-C++ source code with preprocessor directives.
    s   Objective-C++s   objective-c++s   objectivec++s   obj-c++s   objc++s   *.mms   *.hhs   text/x-objective-c++g?(   R^   R_   R`   Ro   Rp   Rq   Rr   Rs   (    (    (    s8   lib/python2.7/site-packages/pygments/lexers/objective.pyR      s   	c           B   s
  e  Z d  Z d Z d g Z d d d d g Z d g Z d Z i d	 e f d
 e	 e e
 e e j e e
  f d e	 e e
  d f d e	 e  f d e	 e e e j  d f d e	 e e  d! f e g d 6d e f d e
 d" f d e	 e j e e
 e e  f d e j f d e
 d f g d 6d e	 e j e e j  d f d e j d f g d 6d e	 e e  d f d e	 e e e j  f d e	 e e e j e e e  f d e	 e e e
  d f d e	 e e e e e  f d e	 e e e  f e g d 6Z e j d  Z d    Z RS(#   sf   
    For Logos + Objective-C source code with preprocessor directives.

    .. versionadded:: 1.6
    t   Logost   logoss   *.xs   *.xis   *.xms   *.xmis   text/x-logosg      ?s   (%orig|%log)\bs*   (%c)\b(\()(\s*)([a-zA-Z$_][\w$]*)(\s*)(\))s   (%init)\b(\()t   logos_init_directives   (%init)(?=\s*;)s%   (%hook|%group)(\s+)([a-zA-Z$_][\w$]+)s   #pops   (%subclass)(\s+)t   logos_classnameRA   s   \s+RG   s'   ([a-zA-Z$_][\w$]*)(\s*)(=)(\s*)([^);]*)s   ([a-zA-Z$_][\w$]*)s   \)s.   ([a-zA-Z$_][\w$]*)(\s*:\s*)([a-zA-Z$_][\w$]*)?s0   (%config)(\s*\(\s*)(\w+)(\s*=\s*)(.*?)(\s*\)\s*)s   (%ctor)(\s*)(\{)RH   s   (%new)(\s*)(\()(\s*.*?\s*)(\))s   (\s*)(%end)(\s*)RF   s   %(?:hook|ctor|init|c\()c         C   s   t  j j |   r d Sd S(   Ng      ?i    (   R   t   _logos_keywordsRL   (   RN   (    (    s8   lib/python2.7/site-packages/pygments/lexers/objective.pyRQ     s    (   s   #popRw   (   Rv   s   #pop(   R^   R_   R`   Ro   Rp   Rq   Rr   Rs   R	   R   R   R   R
   R7   R   Ri   R   Rj   RM   Rk   Rx   RQ   (    (    (    s8   lib/python2.7/site-packages/pygments/lexers/objective.pyR      sR   			
	c           B   s;  e  Z d  Z d Z d g Z d g Z d g Z i	 d e f d e f d e j	 d f d	 e j
 d
 f d e j d f e d  e dd d e j f e dd d e j j f d!e j f d"e j f d#e j f d$e j f d%e j f d&e j f d'e d(f d)e f d*e f d+e f g d,6e dd d e f dDe j f e dd d e j f dle j f dme j dnf doe e j e e j   f dpe e j e e j!  f dqe e j e e j  f e dd d e j f g	 d 6de j" f g d6d e df e d de j	 f g d 6e d de j
 f d	 e j
 df de j
 df de j
 f g d
 6d e df d+e j  f e d, g dn6d e df e d  de j f e d, g d 6de j# df d'e df de j$ f de f de f g d(6de j# df de j# df e d, g d6Z% d  Z& RS(  s^   
    For `Swift <https://developer.apple.com/swift/>`_ source.

    .. versionadded:: 2.0
    t   Swifts   *.swiftt   swifts   text/x-swifts   \ns   \s+s   //s   comment-singles   /\*s   comment-multis#   #(if|elseif|else|endif|available)\bt   preproct   keywordst   Arrayt!   AutoreleasingUnsafeMutablePointert   BidirectionalReverseViewt   Bitt   Boolt   CFunctionPointert   COpaquePointert   CVaListPointert	   Charactert   ClosedIntervalt   CollectionOfOnet   ContiguousArrayt
   Dictionaryt   DictionaryGeneratort   DictionaryIndext   Doublet   EmptyCollectiont   EmptyGeneratort   EnumerateGeneratort   EnumerateSequencet   FilterCollectionViewt   FilterCollectionViewIndext   FilterGeneratort   FilterSequenceViewRb   t   Float80t   FloatingPointClassificationt   GeneratorOft   GeneratorOfOnet   GeneratorSequencet   HalfOpenIntervalt
   HeapBuffert   HeapBufferStoraget   ImplicitlyUnwrappedOptionalt   IndexingGeneratort   Intt   Int16t   Int32t   Int64t   Int8t   LazyBidirectionalCollectiont   LazyForwardCollectiont   LazyRandomAccessCollectiont   LazySequencet   MapCollectionViewt   MapSequenceGeneratort   MapSequenceViewt   MirrorDispositiont   ObjectIdentifiert   OnHeapt   Optionalt   PermutationGeneratort   QuickLookObjectt   RandomAccessReverseViewt   Ranget   RangeGeneratort   RawBytet   Repeatt   ReverseBidirectionalIndext   ReverseRandomAccessIndext
   SequenceOft   SinkOft   Slicet   StaticStringt   StrideThrought   StrideThroughGeneratort   StrideTot   StrideToGeneratorR   t   UIntt   UInt16t   UInt32t   UInt64t   UInt8t   UTF16t   UTF32t   UTF8t   UnicodeDecodingResultt   UnicodeScalart	   Unmanagedt   UnsafeBufferPointert   UnsafeBufferPointerGeneratort   UnsafeMutableBufferPointert   UnsafeMutablePointert   UnsafePointert   Zip2t   ZipGenerator2t   AbsoluteValuablet	   AnyObjectt   ArrayLiteralConvertiblet   BidirectionalIndexTypet   BitwiseOperationsTypet   BooleanLiteralConvertiblet   BooleanTypet   CVarArgTypet   CollectionTypet
   Comparablet   DebugPrintablet   DictionaryLiteralConvertiblet	   Equatablet)   ExtendedGraphemeClusterLiteralConvertiblet   ExtensibleCollectionTypet   FloatLiteralConvertiblet   FloatingPointTypet   ForwardIndexTypet   GeneratorTypet   Hashablet   IntegerArithmeticTypet   IntegerLiteralConvertiblet   IntegerTypet   IntervalTypet
   MirrorTypet   MutableCollectionTypet   MutableSliceablet   NilLiteralConvertiblet   OutputStreamTypet	   Printablet   RandomAccessIndexTypet   RangeReplaceableCollectionTypet   RawOptionSetTypet   RawRepresentablet   Reflectablet   SequenceTypet   SignedIntegerTypet   SignedNumberTypet   SinkTypet	   Sliceablet
   Streamablet
   Strideablet   StringInterpolationConvertiblet   StringLiteralConvertiblet   UnicodeCodecTypet   UnicodeScalarLiteralConvertiblet   UnsignedIntegerTypet   _ArrayBufferTypet   _BidirectionalIndexTypet   _CocoaStringTypet   _CollectionTypet   _Comparablet   _ExtensibleCollectionTypet   _ForwardIndexTypet   _Incrementablet   _IntegerArithmeticTypet   _IntegerTypet   _ObjectiveCBridgeablet   _RandomAccessIndexTypet   _RawOptionSetTypet   _SequenceTypet   _Sequence_Typet   _SignedIntegerTypet   _SignedNumberTypet
   _Sliceablet   _Strideablet"   _SwiftNSArrayRequiredOverridesTypet   _SwiftNSArrayTypet   _SwiftNSCopyingTypet'   _SwiftNSDictionaryRequiredOverridesTypet   _SwiftNSDictionaryTypet   _SwiftNSEnumeratorTypet   _SwiftNSFastEnumerationTypet#   _SwiftNSStringRequiredOverridesTypet   _SwiftNSStringTypet   _UnsignedIntegerTypet   C_ARGCt   C_ARGVt   Processt   Anyt   AnyClasst   BooleanLiteralTypet   CBoolt   CChart   CChar16t   CChar32t   CDoublet   CFloatt   CIntt   CLongt	   CLongLongt   CShortt   CSignedChart   CUnsignedIntt   CUnsignedLongt   CUnsignedShortt	   CWideChart   ExtendedGraphemeClusterTypet   Float32t   Float64t   FloatLiteralTypet   IntMaxt   IntegerLiteralTypet   StringLiteralTypet   UIntMaxt   UWordt   UnicodeScalarTypet   Voidt   Wordt   NSErrorPointert   NSObjectProtocolt   SelectorR4   s   \bt   abst   advancet   alignoft   alignofValuet   assertt   assertionFailuret   containst   countt   countElementst
   debugPrintt   debugPrintlnt   distancet	   dropFirstt   dropLastt   dumpt	   enumeratet   equalt   extendt
   fatalErrort   filtert   findt   firstt	   getVaListt   indicest   insertt   isEmptyt   joint   lastt   lazyt   lexicographicalComparet   mapt   maxt
   maxElementt   mint
   minElementt   numericCastt   overlapst	   partitiont   preconditiont   preconditionFailuret   prefixt   printt   printlnt   reducet   reflectt	   removeAllt   removeAtIndext
   removeLastt   removeRanget   reverset   sizeoft   sizeofValuet   sortt   sortedt   splicet   splitt
   startsWitht   stridet   strideoft   strideofValuet   swapt   toDebugStringt   toStringt	   transcodet   underestimateCountt   unsafeAddressOft   unsafeBitCastt   unsafeDowncastt   withExtendedLifetimet   withUnsafeMutablePointert   withUnsafeMutablePointerst   withUnsafePointert   withUnsafePointerst
   withVaLists   \$\d+s   0b[01_]+s	   0o[0-7_]+s   0x[0-9a-fA-F_]+sD   [0-9][0-9_]*(\.[0-9_]+[eE][+\-]?[0-9_]+|\.[0-9_]*|[eE][+\-]?[0-9_]+)s   [0-9][0-9_]*t   "R   s/   [(){}\[\].,:;=@#`?]|->|[<&?](?=\w)|(?<=\w)[>!?]s   [/=\-+!*%<>&|^?~]+s   [a-zA-Z_]\w*RF   t   ast   breakt   caset   catcht   continueR   t   defert   dot   elset   fallthrought   fort   guardt   ifR/   t   ist   repeatt   returns	   #selectort   switcht   throwt   tryt   wheret   whiles   @availability\([^)]+\)t   associativityt   conveniencet   dynamict   didSett   finalt   gett   indirectt   infixR1   t   leftt   mutatingt   nonet   nonmutatingt   optionalt   overridet   postfixt
   precedencet   Protocolt   requiredt   rethrowst   rightt   sett   throwsRf   t   unownedR"   t   willSets   @availabilitys   @autoclosures	   @noreturns   @NSApplicationMains
   @NSCopyings
   @NSManageds   @objcs   @UIApplicationMains	   @IBActions   @IBDesignables   @IBInspectables	   @IBOutlets   (as|dynamicType|false|is|nil|self|Self|super|true|__COLUMN__|__FILE__|__FUNCTION__|__LINE__|_|#(?:file|line|column|function))\bs   import\bt   modules9   (class|enum|extension|struct|protocol)(\s+)([a-zA-Z_]\w*)s   (func)(\s+)([a-zA-Z_]\w*)s   (var|let)(\s+)([a-zA-Z_]\w*)R3   t   deinitt   enumt	   extensiont   funct   importt   initt   internalt   lett   operatort   privatet   protocolt   publict   statict   structt	   subscriptt	   typealiast   vars2   :param: [a-zA-Z_]\w*|:returns?:|(FIXME|MARK|TODO):t   comments   #pops   [^\n]s   [^*/]s   #pushs   \*/s   [*/]s   [A-Za-z]\w*s   \\\(s   string-intpsN   \\['"\\nrt]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}s   [^\\"]+s   \\s   \(s   \)c         c   s   d d l  m } m } m } x t j |  |  D]n \ } } } | t k sY | t j k r | | k s} | | k s} | | k r t j j	 } q n  | | | f Vq/ Wd  S(   Ni(   RR   RS   RT   (
   RU   RR   RS   RT   R    RV   R
   R7   RW   RX   (   RY   RN   RR   RS   RT   RZ   R[   R\   (    (    s8   lib/python2.7/site-packages/pygments/lexers/objective.pyRV     s    (   R}   R~   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   Rb   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R  R  R  R  R  R  R  R  R	  R
  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R   R!  R"  R#  R$  R%  R&  R'  R(  R)  R*  R+  R,  R-  R.  R/  R0  R1  R2  R3  R4  R5  R6  R7  R8  R9  R:  R;  R<  R=  R>  R?  R@  RA  (K   RB  RC  RD  RE  RF  RG  RH  RI  RJ  RK  RL  RM  RN  RO  RP  RQ  RR  RS  RT  RU  RV  RW  RX  RY  RZ  R[  R\  R]  R^  R_  R`  Ra  Rb  Rc  Rd  Re  Rf  Rg  Rh  Ri  Rj  Rk  Rl  Rm  Rn  Ro  Rp  Rq  Rr  Rs  Rt  Ru  Rv  Rw  Rx  Ry  Rz  R{  R|  R}  R4   R~  R  R  R  R  R  R  R  R  R  R  R  R  R  (   R  R  R  R  R  R   R  R  R  R  R  R  R  R/   R  R  R  s	   #selectorR  R  R  R  R  ()   R  R  R  R  R  R  R  R  R1   R^  R  R  R  R  R  R  R  R  Rj  R  R  R  R  R  R  Rf   R  R"   R  s   @availabilitys   @autoclosures	   @noreturns   @NSApplicationMains
   @NSCopyings
   @NSManageds   @objcs   @UIApplicationMains	   @IBActions   @IBDesignables   @IBInspectables	   @IBOutlet(   R3   R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  ('   R^   R_   R`   Ro   Rq   Rp   Rr   R   R   t   Singlet	   Multilinet   PreprocR   R   R
   RW   RX   Ri   R   t   BinRd   Rc   Rb   Re   R   R   R   R	   t   Reservedt   Constantt   DeclarationR   R7   Rh   t   Specialt   Interpolt   EscapeRj   RV   (    (    (    s8   lib/python2.7/site-packages/pygments/lexers/objective.pyR     s@  						                                                          	              			           		  					(   R`   RM   t   pygments.lexerR    R   R   R   R   R   R   R   t   pygments.tokenR   R	   R
   R   R   R   R   R   R   t   pygments.lexers.c_cppR   R   t   __all__Rl   R   R   R   R   (    (    (    s8   lib/python2.7/site-packages/pygments/lexers/objective.pyt   <module>
   s   :@	@