ó
¶%^Tc           @   s  d  Z  d d l Z d d l 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 d d l m Z m Z d d l m Z d d l m Z d d l m Z m Z m Z d d	 l m Z d
 d d d d d d g Z d
 e f d „  ƒ  YZ d e f d „  ƒ  YZ  d e f d „  ƒ  YZ! d e! f d „  ƒ  YZ" d e f d „  ƒ  YZ# d e f d „  ƒ  YZ$ d e f d „  ƒ  YZ% d S(   sÕ   
    pygments.lexers.html
    ~~~~~~~~~~~~~~~~~~~~

    Lexers for HTML, XML and related markup.

    :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
iÿÿÿÿN(   t
   RegexLexert   ExtendedRegexLexert   includet   bygroupst   defaultt   using(   t   Textt   Commentt   Operatort   Keywordt   Namet   Stringt   Punctuation(   t   looks_like_xmlt   html_doctype_matches(   t   JavascriptLexer(   t
   ScalaLexer(   t   CssLexert   _indentationt   _starts_block(   t	   RubyLexert	   HtmlLexert   DtdLexert   XmlLexert	   XsltLexert	   HamlLexert
   ScamlLexert	   JadeLexerc           B   s¼  e  Z d  Z d Z d g Z d d d d g Z d d g Z e j e j	 BZ
 i d	 e f d
 e j f d e j f d e d f d e j f d e j f d e j d) f d e j d* f d e j d f d e j f g
 d 6d e f d e d f d e f g d 6d e f d e e j e ƒ d f d e j f d  e j d f g d 6d! e j d f d" e e ƒ f g d 6d# e j d f d$ e e ƒ f g d 6d% e d f d& e d f d' e d f g d 6Z d( „  Z RS(+   so   
    For HTML 4 and XHTML 1 markup. Nested JavaScript and CSS is highlighted
    by the appropriate lexer.
    t   HTMLt   htmls   *.htmls   *.htms   *.xhtmls   *.xslts	   text/htmls   application/xhtml+xmls   [^<&]+s   &\S*?;s   \<\!\[CDATA\[.*?\]\]\>s   <!--t   comments	   <\?.*?\?>s   <![^>]*>s   <\s*script\s*s   script-contentt   tags   <\s*style\s*s   style-contents   <\s*[\w:.-]+s   <\s*/\s*[\w:.-]+\s*>t   roots   [^-]+s   -->s   #popt   -s   \s+s   ([\w:-]+\s*=)(\s*)t   attrs   [\w:-]+s   /?\s*>s   <\s*/\s*script\s*>s   .+?(?=<\s*/\s*script\s*>)s   <\s*/\s*style\s*>s   .+?(?=<\s*/\s*style\s*>)s   ".*?"s   '.*?'s   [^\s>]+c         C   s   t  |  ƒ r d Sd  S(   Ng      à?(   R   (   t   text(    (    s8   /usr/lib/python2.7/dist-packages/pygments/lexers/html.pyt   analyse_textR   s    (   s   script-contentR   (   s   style-contentR   (   t   __name__t
   __module__t   __doc__t   namet   aliasest	   filenamest	   mimetypest   ret
   IGNORECASEt   DOTALLt   flagsR   R
   t   EntityR   t   Preproct   TagR   t	   AttributeR   R   R   R   t   tokensR$   (    (    (    s8   /usr/lib/python2.7/dist-packages/pygments/lexers/html.pyR      s@   				c           B   sh  e  Z d  Z e j e j BZ d Z d g Z d g Z	 d g Z
 i e d ƒ d e e e e j ƒ d f d e e e e j ƒ d	 f d
 e e e e j ƒ d f d e e e e j ƒ d f d e e e j e e ƒ f d e e e e j ƒ f d e j f d e f g	 d 6d e f d e j f d e d f d e f d e j f d e j f g d 6d e f d e d f d e f g d 6e d ƒ d e j f d e j f d  e d f g d 6e d ƒ d! e j f d" e j f d# e j f d e j f d  e d f g d	 6e d ƒ d$ e j f d e j f d  e d f g d 6e d ƒ d% e j f d e j f d  e d f g d 6Z d& „  Z RS('   sR   
    A lexer for DTDs (Document Type Definitions).

    .. versionadded:: 1.5
    t   DTDt   dtds   *.dtds   application/xml-dtdt   commons   (<!ELEMENT)(\s+)(\S+)t   elements   (<!ATTLIST)(\s+)(\S+)t   attlists   (<!ENTITY)(\s+)(\S+)t   entitys   (<!NOTATION)(\s+)(\S+)t   notations   (<!\[)([^\[\s]+)(\s*)(\[)s   (<!DOCTYPE)(\s+)([^>\s]+)s   PUBLIC|SYSTEMs   [\[\]>]R    s   \s+s   (%|&)[^;]*;s   <!--R   s	   [(|)*,?+]s   "[^"]*"s
   \'[^\']*\'s   [^-]+s   -->s   #popR!   s   EMPTY|ANY|#PCDATAs   [^>\s|()?+*,]+t   >s?   CDATA|IDREFS|IDREF|ID|NMTOKENS|NMTOKEN|ENTITIES|ENTITY|NOTATIONs   #REQUIRED|#IMPLIED|#FIXEDs   xml:space|xml:langs   SYSTEM|PUBLIC|NDATAs   SYSTEM|PUBLICc         C   s9   t  |  ƒ r5 d |  k s1 d |  k s1 d |  k r5 d Sd  S(   Ns	   <!ELEMENTs	   <!ATTLISTs   <!ENTITYgš™™™™™é?(   R   (   R#   (    (    s8   /usr/lib/python2.7/dist-packages/pygments/lexers/html.pyR$   ©   s    $(   R%   R&   R'   R,   t	   MULTILINER.   R/   R(   R)   R*   R+   R   R   R	   R   R
   R2   R0   t   ConstantR   R   R   t   Doublet   Singlet   ReservedR3   R4   R$   (    (    (    s8   /usr/lib/python2.7/dist-packages/pygments/lexers/html.pyR   W   sf   												c        
   B   sa  e  Z d  Z e j e j Be j BZ d Z d g Z	 d d d d d d d	 g Z
 d
 d d d d g Z i d e f d e j f d e j f d e d f d e j f d e j f d e j d f d e j f g d 6d e f d e d f d e f g d 6d e f d e j d  f d! e j d f g d 6d e f d" e d f d# e d f d$ e d f g d  6Z d% „  Z RS(&   s=   
    Generic lexer for XML (eXtensible Markup Language).
    t   XMLt   xmls   *.xmls   *.xsls   *.rsss   *.xslts   *.xsds   *.wsdls   *.wsfs   text/xmls   application/xmls   image/svg+xmls   application/rss+xmls   application/atom+xmls   [^<&]+s   &\S*?;s   \<\!\[CDATA\[.*?\]\]\>s   <!--R   s	   <\?.*?\?>s   <![^>]*>s   <\s*[\w:.-]+R   s   <\s*/\s*[\w:.-]+\s*>R    s   [^-]+s   -->s   #popR!   s   \s+s   [\w.:-]+\s*=R"   s   /?\s*>s   ".*?"s   '.*?'s   [^\s>]+c         C   s   t  |  ƒ r d Sd  S(   NgÍÌÌÌÌÌÜ?(   R   (   R#   (    (    s8   /usr/lib/python2.7/dist-packages/pygments/lexers/html.pyR$   Ú   s    (   R%   R&   R'   R,   R=   R.   t   UNICODER/   R(   R)   R*   R+   R   R
   R0   R   R1   R2   R3   R   R4   R$   (    (    (    s8   /usr/lib/python2.7/dist-packages/pygments/lexers/html.pyR   ¯   s8   						c        $   B   sV   e  Z d  Z d Z d g Z d d d g Z d d g Z e d- ƒ Z d+ „  Z	 d, „  Z
 RS(.   s7   
    A lexer for XSLT.

    .. versionadded:: 0.10
    t   XSLTt   xslts   *.xsls   *.xslts   *.xpls   application/xsl+xmls   application/xslt+xmls   apply-importss   apply-templatest	   attributes   attribute-sets   call-templatet   chooseR   t   copys   copy-ofs   decimal-formatR8   t   fallbacks   for-eacht   ift   importR   t   keyt   messages   namespace-aliast   numbert	   otherwiset   outputt   params   preserve-spaces   processing-instructiont   sorts   strip-spacet
   stylesheett   templateR#   t	   transforms   value-oft   variablet   whens
   with-paramc         c   sˆ   x t  j |  | ƒ D]m \ } } } t j d | ƒ } | t j k rr | rr | j d ƒ |  j k rr | t | f Vq | | | f Vq Wd  S(   Ns   </?xsl:([^>]*)/?>?i   (	   R   t   get_tokens_unprocessedR,   t   matchR
   R2   t   groupt   EXTRA_KEYWORDSR	   (   t   selfR#   t   indext   tokent   valuet   m(    (    s8   /usr/lib/python2.7/dist-packages/pygments/lexers/html.pyRY   ö   s
    "-c         C   s    t  |  ƒ r d |  k r d Sd  S(   Ns   <xslgš™™™™™é?(   R   (   R#   (    (    s8   /usr/lib/python2.7/dist-packages/pygments/lexers/html.pyR$   ÿ   s    (#   s   apply-importss   apply-templatesRG   s   attribute-sets   call-templateRH   s   comments   copys   copy-ofs   decimal-formats   elementRJ   s   for-eachRK   RL   s   includes   keys   messages   namespace-aliasRO   RP   s   outputRR   s   preserve-spaces   processing-instructions   sorts   strip-spaceRT   s   templates   textRV   s   value-ofRW   RX   s
   with-param(   R%   R&   R'   R(   R)   R*   R+   t   setR\   RY   R$   (    (    (    s8   /usr/lib/python2.7/dist-packages/pygments/lexers/html.pyR   ß   s    	       			c           B   sƒ  e  Z d  Z d Z d g Z d g Z d g Z e j Z	 d Z
 d e
 d Z i d e f d	 e f g d
 6d e j d f d e j d f g d 6d e d f d e d e e e e ƒ ƒ d
 f e d ƒ g d 6e d ƒ d e j d f d e
 d e j d f d e
 d e
 d e e e j e ƒ d f d e
 d e e d ƒ d f d e
 d e e j d ƒ d f d e d e e e e ƒ ƒ d f d e
 d e e j d  ƒ d f e d ƒ g	 d! 6e d ƒ d" e
 d# e e ƒ f d$ e
 d% e e ƒ f d& e d' f d( e d) f d* e f e d ƒ g d 6d+ e f d, e
 d- e e j e e ƒ e j ƒ f d. e d
 f g d 6d/ e f d0 e j  d1 f d2 e j  f d3 e d f g d' 6d4 e f d5 e j! d f d6 e j! j" d f d7 e j! j# d f d8 e d f d9 e d f g d1 6e
 d: e f d. e d
 f g d 6e
 d: e j f d. e d
 f g d 6d+ e j f d, e
 d- e e j e e ƒ e j ƒ f d. e d
 f g d  6Z$ RS(;   s5   
    For Haml markup.

    .. versionadded:: 1.3
    t   Hamlt   hamls   *.hamls   text/x-hamls   (?: \|\n(?=.* \|)|.)s
   (?:,\s*\n|t   )s   [ \t]*\ns   [ \t]*R    s	   \.[\w:-]+R   s	   \#[\w:-]+t   csss   [&!]?==t   plains   ([&!]?[=~])(s   *\n)s   eval-or-plains   %[\w:-]+s   !!!s   *\ns   #pops   (/)(\[s   *?\])(t   /s   html-comment-blocks   -#s   haml-comment-blocks   (-)(t   :s   filter-blockt   contents   \{(,\n|s   )*?\}s   \[s   *?\]s   \(s   html-attributess	   /[ \t]*\ns   #pop:2s   [<>]{1,2}(?=[ \t=])s   ([^#\n]|#[^{\n]|(\\\\)*\\#\{)+s   (#\{)(s   *?)(\})s   \ns   \s+s   [\w:-]+[ \t]*=s   html-attribute-values   [\w:-]+s   \)s   [ \t]+s   \w+s   @\w+s   \$\w+s   '(\\\\|\\'|[^'\n])*'s   "(\\\\|\\"|[^"\n])*"t   +(%   R%   R&   R'   R(   R)   R*   R+   R,   R-   R/   t   _dott
   _comma_dotR   R   R
   t   Classt   FunctionR   R   R   R   R   R   R2   t	   NamespaceR   t   SpecialR   R1   t	   DecoratorR   t   InterpolR3   t   Variablet   Instancet   GlobalR4   (    (    (    s8   /usr/lib/python2.7/dist-packages/pygments/lexers/html.pyR     s~   											c           B   s›  e  Z d  Z d Z d g Z d g Z d g Z e j Z	 d Z
 i d e f d e f g d 6d	 e j d
 f d e j d
 f g d 6d e d f d e
 d e e e e ƒ ƒ d f e d ƒ g d 6e d ƒ d e j d
 f d e
 d e j d f d e
 d e
 d e e e j e ƒ d f d e
 d e e d ƒ d f d e
 d e e j d ƒ d f d e
 d e e e e e ƒ ƒ d f d e
 d e e e e ƒ ƒ d f d e
 d e e j d ƒ d f e d ƒ g
 d  6e d ƒ d! e
 d" e e ƒ f d# e
 d$ e e ƒ f d% e d& f d' e d( f d) e f e d ƒ g d
 6d* e f d+ e
 d, e e j e e ƒ e j ƒ f d- e d f g d 6d. e f d/ e j  d0 f d1 e j  f d2 e d f g d& 6d3 e f d4 e j! d f d5 e j! j" d f d6 e j! j# d f d7 e d f d8 e d f g d0 6e
 d9 e f d- e d f g d 6e
 d9 e j f d- e d f g d 6d* e j f d+ e
 d, e e j e e ƒ e j ƒ f d- e d f g d 6Z$ RS(:   st   
    For `Scaml markup <http://scalate.fusesource.org/>`_.  Scaml is Haml for Scala.

    .. versionadded:: 1.4
    t   Scamlt   scamls   *.scamls   text/x-scamlt   .s   [ \t]*\ns   [ \t]*R    s	   \.[\w:-]+R   s	   \#[\w:-]+Rf   s   [&!]?==Rg   s   ([&!]?[=~])(s   *\n)s   eval-or-plains   %[\w:-]+s   !!!s   *\ns   #pops   (/)(\[s   *?\])(Rh   s   html-comment-blocks   -#s   scaml-comment-blocks   (-@\s*)(import)?(s   (-)(Ri   s   filter-blockRj   s   \{(,\n|s   )*?\}s   \[s   *?\]s   \(s   html-attributess	   /[ \t]*\ns   #pop:2s   [<>]{1,2}(?=[ \t=])s   ([^#\n]|#[^{\n]|(\\\\)*\\#\{)+s   (#\{)(s   *?)(\})s   \ns   \s+s   [\w:-]+[ \t]*=s   html-attribute-values   [\w:-]+s   \)s   [ \t]+s   \w+s   @\w+s   \$\w+s   '(\\\\|\\'|[^'\n])*'s   "(\\\\|\\"|[^"\n])*"Rk   (%   R%   R&   R'   R(   R)   R*   R+   R,   R-   R/   Rl   R   R   R
   Rn   Ro   R   R   R   R   R   R   R2   Rp   R   Rq   R   R1   R	   Rr   R   Rs   R3   Rt   Ru   Rv   R4   (    (    (    s8   /usr/lib/python2.7/dist-packages/pygments/lexers/html.pyR   s  s‚   											c           B   sž  e  Z d  Z d Z d g Z d g Z d g Z e j Z	 d Z
 i d e f d e f g d 6d	 e j d
 f d e j d
 f g d 6d e d f d e
 d e e e e ƒ ƒ d f e d ƒ g d 6e d ƒ d e
 d e j d f d e
 d e
 d e e e j e ƒ d f d e
 d e e d ƒ d f d e
 d e e j d ƒ d f d e
 d e e e e e ƒ ƒ d f d e
 d e e e e ƒ ƒ d f d e
 d e e j d ƒ d f d e j d
 f d  e d f g
 d! 6e d ƒ d" e
 d# e e ƒ f d$ e
 d% e e ƒ f d& e d' f d( e d) f d* e f e d ƒ g d
 6d+ e f d, e
 d- e e j e e ƒ e j ƒ f d. e d f g d 6d/ e f d0 e j  d1 f d e j  f d2 e d f g d' 6d3 e f d4 e j! d f d5 e j! j" d f d6 e j! j# d f d7 e d f d8 e d f g d1 6e
 d9 e f d. e d f g d 6e
 d9 e j f d. e d f g d 6d+ e j f d, e
 d- e e j e e ƒ e j ƒ f d. e d f g d 6Z$ RS(:   sŸ   
    For Jade markup.
    Jade is a variant of Scaml, see:
    http://scalate.fusesource.org/documentation/scaml-reference.html

    .. versionadded:: 1.4
    t   Jadet   jades   *.jades   text/x-jadeRy   s   [ \t]*\ns   [ \t]*R    s	   \.[\w:-]+R   s	   \#[\w:-]+Rf   s   [&!]?==Rg   s   ([&!]?[=~])(s   *\n)s   eval-or-plains   !!!s   *\ns   #pops   (/)(\[s   *?\])(Rh   s   html-comment-blocks   -#s   scaml-comment-blocks   (-@\s*)(import)?(s   (-)(Ri   s   filter-blocks   [\w:-]+s   \|Rj   s   \{(,\n|s   )*?\}s   \[s   *?\]s   \(s   html-attributess	   /[ \t]*\ns   #pop:2s   [<>]{1,2}(?=[ \t=])s   ([^#\n]|#[^{\n]|(\\\\)*\\#\{)+s   (#\{)(s   *?)(\})s   \ns   \s+s   [\w:-]+[ \t]*=s   html-attribute-values   \)s   [ \t]+s   \w+s   @\w+s   \$\w+s   '(\\\\|\\'|[^'\n])*'s   "(\\\\|\\"|[^"\n])*"Rk   (%   R%   R&   R'   R(   R)   R*   R+   R,   R-   R/   Rl   R   R   R
   Rn   Ro   R   R   R   R   R   R   Rp   R   Rq   R   R1   R	   Rr   R2   R   Rs   R3   Rt   Ru   Rv   R4   (    (    (    s8   /usr/lib/python2.7/dist-packages/pygments/lexers/html.pyR   ã  s€   											(&   R'   R,   t   pygments.lexerR    R   R   R   R   R   t   pygments.tokenR   R   R   R	   R
   R   R   t   pygments.utilR   R   t   pygments.lexers.javascriptR   t   pygments.lexers.jvmR   t   pygments.lexers.cssR   R   R   t   pygments.lexers.rubyR   t   __all__R   R   R   R   R   R   R   (    (    (    s8   /usr/lib/python2.7/dist-packages/pygments/lexers/html.pyt   <module>
   s"   .4:X0%op