a
    ¨ˆc¨H  ã                   @   st   d Z ddlZddl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gZG dd„ deƒZG dd„ deƒZdS )	zÚ
    pygments.lexers.rebol
    ~~~~~~~~~~~~~~~~~~~~~

    Lexers for the REBOL and related languages.

    :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
é    N)Ú
RegexLexerÚbygroups)	ÚTextÚCommentÚOperatorÚKeywordÚNameÚStringÚNumberÚGenericÚ
WhitespaceÚ
RebolLexerÚRedLexerc                #   @   sþ  e Zd ZdZdZdgZg d¢ZdgZej	ej
B ZdZdd„ Zd	efd
ejdfdefgdefdejdfdejfdejdfdejfdedfdedfdejfdejfdefdejd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jfd$ejfd%e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d0efd1ejfd2efd3ejfd4ejd5fd6efg!d7efeej fd8efd9ej fded:fgd;efeej fd8efd9ej fded<fd=ed:fgd7ejfeejfd9ejfdejd:fged ejd:fd>ejd:fd?ejd:fgeejfdejd@fdAejfdBejd:fgd7ejfeejfd8ejfd9ejfdejd:fgdCejfdDejd:fgdejfdEejfd=ejd:fgd7efeefd8efd9efded:fgd;efeefd8efd9efded<fd=ed:fgdFed<fdGed:fded+fded-fdHefgdIœZ!dJdK„ Z"dLS )Mr   zN
    A `REBOL <http://www.rebol.com/>`_ lexer.

    .. versionadded:: 1.1
    ZREBOLZrebol)z*.rz*.r3z*.rebztext/x-rebolú(?:\^\([0-9a-f]{1,4}\)*)c                 c   sÐ  |  ¡ }t d|¡r*| ¡ tj|fV  �n¢t d|¡rL| ¡ tj|fV  �n€t d|¡rn| ¡ tj|fV  �n^t d|¡r�| ¡ t	j
|fV  �n<t d|¡r²| ¡ tj|fV  �nt d|¡rÒ| ¡ tj|fV  nút d|¡rð| ¡ t	|fV  nÜt d|¡�r| ¡ t|fV  n¼t d	|¡�r0| ¡ t	|fV  nœt d
|¡�rR| ¡ t	j|fV  nzt d|¡�rv| ¡ tjj|fV  nVt d|¡�r˜| ¡ tj|fV  n4t d|¡�rº| ¡ tj|fV  n| ¡ tj|fV  d S )Nú.*:$a  (native|alias|all|any|as-string|as-binary|bind|bound\?|case|catch|checksum|comment|debase|dehex|exclude|difference|disarm|either|else|enbase|foreach|remove-each|form|free|get|get-env|if|in|intersect|loop|minimum-of|maximum-of|mold|new-line|new-line\?|not|now|prin|print|reduce|compose|construct|repeat|reverse|save|script\?|set|shift|switch|throw|to-hex|trace|try|type\?|union|unique|unless|unprotect|unset|until|use|value\?|while|compress|decompress|secure|open|close|read|read-io|write-io|write|update|query|wait|input\?|exp|log-10|log-2|log-e|square-root|cosine|sine|tangent|arccosine|arcsine|arctangent|protect|lowercase|uppercase|entab|detab|connected\?|browse|launch|stats|get-modes|set-modes|to-local-file|to-rebol-file|encloak|decloak|create-link|do-browser|bind\?|hide|draw|show|size-text|textinfo|offset-to-caret|caret-to-offset|local-request-file|rgb-to-hsv|hsv-to-rgb|crypt-strength\?|dh-make-key|dh-generate-key|dh-compute-key|dsa-make-key|dsa-generate-key|dsa-make-signature|dsa-verify-signature|rsa-make-key|rsa-generate-key|rsa-encrypt)$a4  (add|subtract|multiply|divide|remainder|power|and~|or~|xor~|minimum|maximum|negate|complement|absolute|random|head|tail|next|back|skip|at|pick|first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|last|path|find|select|make|to|copy\*|insert|remove|change|poke|clear|trim|sort|min|max|abs|cp|copy)$a—  (error|source|input|license|help|install|echo|Usage|with|func|throw-on-error|function|does|has|context|probe|\?\?|as-pair|mod|modulo|round|repend|about|set-net|append|join|rejoin|reform|remold|charset|array|replace|move|extract|forskip|forall|alter|first+|also|take|for|forever|dispatch|attempt|what-dir|change-dir|clean-path|list-dir|dirize|rename|split-path|delete|make-dir|delete-dir|in-dir|confirm|dump-obj|upgrade|what|build-tag|process-source|build-markup|decode-cgi|read-cgi|write-user|save-user|set-user-name|protect-system|parse-xml|cvs-date|cvs-version|do-boot|get-net-info|desktop|layout|scroll-para|get-face|alert|set-face|uninstall|unfocus|request-dir|center-face|do-events|net-error|decode-url|parse-header|parse-header-date|parse-email-addrs|import-email|send|build-attach-body|resend|show-popup|hide-popup|open-events|find-key-face|do-face|viewtop|confine|find-window|insert-event-func|remove-event-func|inform|dump-pane|dump-face|flag-face|deflag-face|clear-fields|read-net|vbug|path-thru|read-thru|load-thru|do-thru|launch-thru|load-image|request-download|do-face-alt|set-font|set-para|get-style|set-style|make-face|stylize|choose|hilight-text|hilight-all|unlight-text|focus|scroll-drag|clear-face|reset-face|scroll-face|resize-face|load-stock|load-stock-block|notify|request|flash|request-color|request-pass|request-text|request-list|request-date|request-file|dbug|editor|link-relative-path|emailer|parse-error)$zO(halt|quit|do|load|q|recycle|call|run|ask|parse|view|unview|return|exit|break)$zREBOL$úto-.*z5(\+|-|\*|/|//|\*\*|and|or|xor|=\?|=|==|<>|<|>|<=|>=)$z.*\?$ú.*\!$ú'.*ú#.*ú%.*)ÚgroupÚreÚmatchÚstartr   Ú
Subheadingr   ÚBuiltinÚFunctionr   Ú	NamespaceÚ	ExceptionZHeadingr   ÚTypeÚVariableÚInstanceÚLabelÚ	Decorator©Úlexerr   Úword© r'   úX/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pygments/lexers/rebol.pyÚword_callback#   sT    íúçþÿzRebolLexer.word_callbackú[^R]+z
REBOL\s+\[ÚscriptÚRú\s+ú#"Úcharz#\{[0-9a-f]*\}ú2#\{Úbin2ú64#\{[0-9a-z+/=\s]*\}ú"Ústringú\{Ústring2ú;#+.*\nú;\*+.*\nú;.*\nú%"Ú
stringFileú%[^(^{")\s\[\]]+ú[+-]?([a-z]{1,3})?\$\d+(\.\d+)?ú[+-]?\d+\:\d+(\:\d+)?(\.\d+)?zJ\d+[\-/][0-9a-z]+[\-/]\d+(\/\d+\:\d+((\:\d+)?([.\d+]?([+-]?\d+:\d+)?)?)?)?ú\d+(\.\d+)+\.\d+ú\d+X\d+ú#[+-]?\d+(\'\d+)?([.,]\d*)?E[+-]?\d+ú[+-]?\d+(\'\d+)?[.,]\d*ú[+-]?\d+(\'\d+)?ú[\[\]()]ú [a-z]+[^(^{"\s:)]*://[^(^{"\s)]*ú mailto:[^(^{"@\s)]+@[^(^{"@\s)]+ú[^(^{"@\s)]+@[^(^{"@\s)]+ú
comment\s"ÚcommentString1úcomment\s\{ÚcommentString2úcomment\s\[ÚcommentBlockúcomment\s[^(\s{"\[]+z/[^(^{")\s/[\]]*z"([^(^{")\s/[\]]+)(?=[:({"\s/\[\]])ú
<[\w:.-]*>ú<[^(<>\s")]+Útagú([^(^{")\s]+)ú[^(^")]+ú[(|)]+ú\^.ú#popú	[^(^{})]+ú#pushú\}ú\^."ú."Ú	tagStringú[^(<>\r\n")]+ú>ú(\d+\.)+ú\d+ú([01]\s*){8}ú\[ú\]ú[^(\[\]"{)]+©Úrootr+   r4   r6   r;   r/   rQ   r\   Útupler1   rI   rK   rM   c                 C   s,   t  d| t j¡rdS t  d| t j¡r(dS dS )zS
        Check if code contains REBOL header and so it probably not R code
        z^\s*REBOL\s*\[g      ð?z\s*REBOL\s*\[g      à?N)r   r   Ú
IGNORECASEÚsearch)Útextr'   r'   r(   Úanalyse_textê   s    zRebolLexer.analyse_textN)#Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚaliasesÚ	filenamesÚ	mimetypesr   rh   Ú	MULTILINEÚflagsÚ	escape_rer)   r   r   ÚStrongr   r	   ÚCharr
   ÚHexÚSpecialÚPreprocr   r#   ÚFloatÚOtherr   ÚConstantÚ	AttributeÚTagÚEscapeÚtokensrk   r'   r'   r'   r(   r      sÚ   W
ý


ÿ
Þ%ûú	
ü

ý

ü
û
þ
ýûú	û—rc                $   @   s  e Zd ZdZdZddgZddgZddgZej	ej
B Zd	Zd
d„ Zdefdejdfdejdfdefgdefdejdfdejfdejdfdejfdeejejeƒfdedfdedfdejfdejfdefd ejd!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jfd)ejfd*efd+ejfd,ejfd-ejfd.ejfd/ed0fd1ed2fd3ed4fd5efd6ej!fd7efd8ej"fd9ej"d:fd;efg"d<efeej#fd=efd>ej#fded?fgd@efeej#fd=efd>ej#fdedAfdBed?fgd<ejfeejfd>ejfdejd?fged ejd?fdCejd?fdDejd?fgeej"fdej"dEfdFej"fdGej"d?fgd<ej"feej"fd=ej"fd>ej"fdej"d?fgdHej fdIej d?fgdejfdJejfdBejd?fgd<efeefd=efd>efded?fgd@efeefd=efd>efdedAfdBed?fgdKedAfdLed?fded0fded2fdMefgdNœZ$dOS )Pr   zX
    A `Red-language <http://www.red-lang.org/>`_ lexer.

    .. versionadded:: 2.0
    ZRedZredz
red/systemz*.redz*.redsz
text/x-redztext/x-red-systemr   c                 c   s  |  ¡ }t d|¡r*| ¡ tj|fV  �nìt d|¡rL| ¡ tj|fV  �nÊt d|¡rn| ¡ tj|fV  �n¨t d|¡r’| ¡ tjj	|fV  �n„t d|¡r´| ¡ t
j|fV  �nbt d|¡rÖ| ¡ tj|fV  �n@t d|¡rö| ¡ t
|fV  �n t d|¡�r| ¡ t
j|fV  nþt d	|¡�r8| ¡ t
|fV  nÞt d
|¡�rX| ¡ t|fV  n¾t d|¡�rz| ¡ t
j|fV  nœt d|¡�rž| ¡ tjj|fV  nxt d|¡�rÀ| ¡ tj|fV  nVt d|¡�râ| ¡ tj|fV  n4t d|¡�r| ¡ tj|fV  n| ¡ tj|fV  d S )Nr   a  (if|unless|either|any|all|while|until|loop|repeat|foreach|forall|func|function|does|has|switch|case|reduce|compose|get|set|print|prin|equal\?|not-equal\?|strict-equal\?|lesser\?|greater\?|lesser-or-equal\?|greater-or-equal\?|same\?|not|type\?|stats|bind|union|replace|charset|routine)$af  (make|random|reflect|to|form|mold|absolute|add|divide|multiply|negate|power|remainder|round|subtract|even\?|odd\?|and~|complement|or~|xor~|append|at|back|change|clear|copy|find|head|head\?|index\?|insert|length\?|next|pick|poke|remove|reverse|select|sort|skip|swap|tail|tail\?|take|trim|create|close|delete|modify|open|open\?|query|read|rename|update|write)$z`(yes|on|no|off|true|false|tab|cr|lf|newline|escape|slash|sp|space|null|none|crlf|dot|null-byte)$ze(#system-global|#include|#enum|#define|#either|#if|#import|#export|#switch|#default|#get-definition)$zš(system|halt|quit|quit-return|do|load|q|recycle|call|run|ask|parse|raise-error|return|exit|break|alias|push|pop|probe|\?\?|spec-of|body-of|quote|forever)$zý(action\?|block\?|char\?|datatype\?|file\?|function\?|get-path\?|zero\?|get-word\?|integer\?|issue\?|lit-path\?|lit-word\?|logic\?|native\?|op\?|paren\?|path\?|refinement\?|set-path\?|set-word\?|string\?|unset\?|any-struct\?|none\?|word\?|any-series\?)$z(JNICALL|stdcall|cdecl|infix)$r   zN(\+|-\*\*|-|\*\*|//|/|\*|and|or|xor|=\?|===|==|=|<>|<=|>=|<<<|>>>|<<|>>|<|>%)$r   r   r   r   z:.*)r   r   r   r   r   r   r   r   r   ZPseudor   r   r   r   r   r    r!   r"   r#   r$   r'   r'   r(   r)     s\    ûûÿÿþýÿzRedLexer.word_callbackr*   zRed/System\s+\[r+   zRed\s+\[r,   r-   r.   r/   z#\{[0-9a-f\s]*\}r0   r1   r2   z$([0-9a-f]+)(h)((\s)|(?=[\[\]{}"()]))r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   zH\d+[\-/][0-9a-z]+[\-/]\d+(/\d+:\d+((:\d+)?([\.\d+]?([+-]?\d+:\d+)?)?)?)?r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   z/[^(^{^")\s/[\]]*z#([^(^{^")\s/[\]]+)(?=[:({"\s/\[\]])rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   N)%rl   rm   rn   ro   rp   rq   rr   rs   r   rh   rt   ru   rv   r)   r   r   rw   r   r	   rx   r
   ry   r   r   r    r   rz   r{   r#   r|   r}   r   r~   r   r€   r�   r‚   r'   r'   r'   r(   r   ö   sà   8

ü

ÿ
ÿ
Ü'ûú	
ü

ý

ü
û
þ
ýûú	û”)ro   r   Zpygments.lexerr   r   Zpygments.tokenr   r   r   r   r   r	   r
   r   r   Ú__all__r   r   r'   r'   r'   r(   Ú<module>   s   
, c