ó
*T_Tc           @   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-2014 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
iÿÿÿÿN(   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        6      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 dn d9 d: ƒe f e do d9 d: ƒe j f dD e j f dE e j f dF e j f dG e j f dH e e e ƒ dp f dK e e e ƒ dq f dM e f e g dN 6dO e e j e e j e e ƒ dr f dQ e e j e e j ƒ dI f dR e e j e e j e e ƒ ds f dS e e j e e j ƒ dI f dT e e j e e ƒ dt f dU e j dI f g dJ 6dV e e j e ƒ dL f dW e e j e ƒ dI f g dL 6e dX ƒ e dN ƒ dY e f dZ e d[ f d\ e dI f g dP 6d] e e e e e ƒ e e j ƒ d^ f e g d_ 6e dX ƒ d` e f da e f db e e e ƒ e e j ƒ f dc e j f dY e dI f dZ e dd f e dI ƒ g d^ 6de e df f dg e
 dI f e dh ƒ g d 6de e d[ f dg e dI f e dh ƒ g df 6di e dj f dk e
 dI f e dh ƒ g d 6di e d[ f dk e dI f e dh ƒ g dj 6d\ e
 dI f e dh ƒ g d 6Z ‡  ‡ f dl †  Z ‡ f dm †  Z RS(u   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   @autoreleasepoolt   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(    s=   /usr/lib/python2.7/dist-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(    s=   /usr/lib/python2.7/dist-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#   s   copyR%   R&   R'   R(   R)   s   readonlyR+   s   setters   getterR.   s   ins   outR1   s   releaseR3   s   @dynamics	   @optionals	   @requireds   @autoreleasepool(	   s   idR6   s   ClassR8   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]   (    s=   /usr/lib/python2.7/dist-packages/pygments/lexers/objective.pyR   +   s°   	       		
			
			(   RM   t   compile(   R]   R   (    (   RO   RP   R]   s=   /usr/lib/python2.7/dist-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(    (    (    s=   /usr/lib/python2.7/dist-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   (    (    (    s=   /usr/lib/python2.7/dist-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   (    (    s=   /usr/lib/python2.7/dist-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   (    (    (    s=   /usr/lib/python2.7/dist-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 ƒ d e j f 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 6d e f d e j f d e j f d e j f d  e j d! f d" e e j e e j ƒ f d# e e j e e j  ƒ f d$ e e j e e j ƒ f 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 d! 6d e d( f e d ƒ d. e j f e d ƒ g d 6d/ e j" d0 f d e d( f d1 e j# f d2 e f d3 e f g d 6d4 e j" d+ f d5 e j" d( f e d ƒ g d0 6Z$ d6 „  Z% RS(7   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)\bt   preproct   keywordss  (Array|AutoreleasingUnsafeMutablePointer|BidirectionalReverseView|Bit|Bool|CFunctionPointer|COpaquePointer|CVaListPointer|Character|ClosedInterval|CollectionOfOne|ContiguousArray|Dictionary|DictionaryGenerator|DictionaryIndex|Double|EmptyCollection|EmptyGenerator|EnumerateGenerator|EnumerateSequence|FilterCollectionView|FilterCollectionViewIndex|FilterGenerator|FilterSequenceView|Float|Float80|FloatingPointClassification|GeneratorOf|GeneratorOfOne|GeneratorSequence|HalfOpenInterval|HeapBuffer|HeapBufferStorage|ImplicitlyUnwrappedOptional|IndexingGenerator|Int|Int16|Int32|Int64|Int8|LazyBidirectionalCollection|LazyForwardCollection|LazyRandomAccessCollection|LazySequence|MapCollectionView|MapSequenceGenerator|MapSequenceView|MirrorDisposition|ObjectIdentifier|OnHeap|Optional|PermutationGenerator|QuickLookObject|RandomAccessReverseView|Range|RangeGenerator|RawByte|Repeat|ReverseBidirectionalIndex|ReverseRandomAccessIndex|SequenceOf|SinkOf|Slice|StaticString|StrideThrough|StrideThroughGenerator|StrideTo|StrideToGenerator|String|UInt|UInt16|UInt32|UInt64|UInt8|UTF16|UTF32|UTF8|UnicodeDecodingResult|UnicodeScalar|Unmanaged|UnsafeBufferPointer|UnsafeBufferPointerGenerator|UnsafeMutableBufferPointer|UnsafeMutablePointer|UnsafePointer|Zip2|ZipGenerator2|AbsoluteValuable|AnyObject|ArrayLiteralConvertible|BidirectionalIndexType|BitwiseOperationsType|BooleanLiteralConvertible|BooleanType|CVarArgType|CollectionType|Comparable|DebugPrintable|DictionaryLiteralConvertible|Equatable|ExtendedGraphemeClusterLiteralConvertible|ExtensibleCollectionType|FloatLiteralConvertible|FloatingPointType|ForwardIndexType|GeneratorType|Hashable|IntegerArithmeticType|IntegerLiteralConvertible|IntegerType|IntervalType|MirrorType|MutableCollectionType|MutableSliceable|NilLiteralConvertible|OutputStreamType|Printable|RandomAccessIndexType|RangeReplaceableCollectionType|RawOptionSetType|RawRepresentable|Reflectable|SequenceType|SignedIntegerType|SignedNumberType|SinkType|Sliceable|Streamable|Strideable|StringInterpolationConvertible|StringLiteralConvertible|UnicodeCodecType|UnicodeScalarLiteralConvertible|UnsignedIntegerType|_ArrayBufferType|_BidirectionalIndexType|_CocoaStringType|_CollectionType|_Comparable|_ExtensibleCollectionType|_ForwardIndexType|_Incrementable|_IntegerArithmeticType|_IntegerType|_ObjectiveCBridgeable|_RandomAccessIndexType|_RawOptionSetType|_SequenceType|_Sequence_Type|_SignedIntegerType|_SignedNumberType|_Sliceable|_Strideable|_SwiftNSArrayRequiredOverridesType|_SwiftNSArrayType|_SwiftNSCopyingType|_SwiftNSDictionaryRequiredOverridesType|_SwiftNSDictionaryType|_SwiftNSEnumeratorType|_SwiftNSFastEnumerationType|_SwiftNSStringRequiredOverridesType|_SwiftNSStringType|_UnsignedIntegerType|C_ARGC|C_ARGV|Process|Any|AnyClass|BooleanLiteralType|CBool|CChar|CChar16|CChar32|CDouble|CFloat|CInt|CLong|CLongLong|CShort|CSignedChar|CUnsignedInt|CUnsignedLong|CUnsignedShort|CWideChar|ExtendedGraphemeClusterType|Float32|Float64|FloatLiteralType|IntMax|IntegerLiteralType|StringLiteralType|UIntMax|UWord|UnicodeScalarType|Void|Word|NSErrorPointer|NSObjectProtocol|Selector)\bs  (abs|advance|alignof|alignofValue|assert|assertionFailure|contains|count|countElements|debugPrint|debugPrintln|distance|dropFirst|dropLast|dump|enumerate|equal|extend|fatalError|filter|find|first|getVaList|indices|insert|isEmpty|join|last|lazy|lexicographicalCompare|map|max|maxElement|min|minElement|numericCast|overlaps|partition|precondition|preconditionFailure|prefix|print|println|reduce|reflect|removeAll|removeAtIndex|removeLast|removeRange|reverse|sizeof|sizeofValue|sort|sorted|splice|split|startsWith|stride|strideof|strideofValue|suffix|swap|toDebugString|toString|transcode|underestimateCount|unsafeAddressOf|unsafeBitCast|unsafeDowncast|withExtendedLifetime|withUnsafeMutablePointer|withUnsafeMutablePointers|withUnsafePointer|withUnsafePointers|withVaList)\bs   \$\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   sW   (break|case|continue|default|do|else|fallthrough|for|if|in|return|switch|where|while)\bs   @availability\([^)]+\)sW  (associativity|convenience|dynamic|didSet|final|get|infix|inout|lazy|left|mutating|none|nonmutating|optional|override|postfix|precedence|prefix|Protocol|required|right|set|Type|unowned|weak|willSet|@(availability|autoclosure|noreturn|NSApplicationMain|NSCopying|NSManaged|objc|UIApplicationMain|IBAction|IBDesignable|IBInspectable|IBOutlet))\bs`   (as|dynamicType|false|is|nil|self|Self|super|true|__COLUMN__|__FILE__|__FUNCTION__|__LINE__|_)\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*)s„   (class|deinit|enum|extension|func|import|init|internal|let|operator|private|protocol|public|static|struct|subscript|typealias|var)\bs2   :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\   (    (    s=   /usr/lib/python2.7/dist-packages/pygments/lexers/objective.pyRV   Ü  s    (&   R^   R_   R`   Ro   Rq   Rp   Rr   R   R   t   Singlet	   Multilinet   PreprocR   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   (    (    (    s=   /usr/lib/python2.7/dist-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   (    (    (    s=   /usr/lib/python2.7/dist-packages/pygments/lexers/objective.pyt   <module>
   s   :@	«?