3 ��X�H � @ st d Z ddlZddlmZmZ ddlmZmZmZm Z m Z mZmZm Z mZ ddgZG dd� de�ZG dd� de�ZdS ) z� pygments.lexers.rebol ~~~~~~~~~~~~~~~~~~~~~ Lexers for the REBOL and related languages. :copyright: Copyright 2006-2017 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 Zd ZdZdZdgZdddgZdgZej ej B ZdZd d � Z defdejd fdefgdefdejdfdejfdejdfdejfdedfdedfdejfdejfdefdejdfdejfd ejfd!ejfd"ejfd#ejfd$ejfd%ejfd&ejfd'efd(ejfd)ejfd*ejfd+ejfd,ed-fd.ed/fd0ed1fd2efd3ejfd4e fd5ejfd6ejd7fd8efg!d9efeej fd:efd;ej fded<fgd=efeej fd:efd;ej fded>fd?ed<fgd9ejfeejfd;ejfdejd<fged ejd<fd@ejd<fdAejd<fgeejfdejdBfdCejfdDejd<fgd9ejfeejfd:ejfd;ejfdejd<fgdEejfdFejd<fgdejfdGejfd?ejd<fgd9efeefd:efd;efded<fgd=efeefd:efd;efded>fd?ed<fgdHed>fdIed<fded-fded/fdJefgdK� Z!dLdM� Z"dNS )Or zN A `REBOL <http://www.rebol.com/>`_ lexer. .. versionadded:: 1.1 ZREBOLZrebolz*.rz*.r3z*.rebztext/x-rebolz(?:\^\([0-9a-f]{1,4}\)*)c c s� |j � }tjd|�r*|j� tj|fV �n�tjd|�rL|j� tj|fV �n�tjd|�rn|j� tj|fV �n^tjd|�r�|j� t j |fV �n<tjd|�r�|j� tj|fV �ntjd|�r�|j� tj|fV n�tjd|�r�|j� t |fV n�tjd|��r|j� t |fV n�tjd |��r0|j� t |fV n�tjd |��rR|j� t j|fV nztjd|��rv|j� tjj|fV nVtjd|��r�|j� tj|fV n4tjd |��r�|j� tj|fV n|j� tj|fV d S )Nz.*:$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)$zREBOL$zto-.*z5(\+|-|\*|/|//|\*\*|and|or|xor|=\?|=|==|<>|<|>|<=|>=)$z.*\?$z.*\!$z'.*z#.*z%.*)�group�re�match�startr � Subheadingr �Builtin�Functionr � Namespace� ExceptionZHeadingr �Type�Variable�Instance�Label� Decorator)�lexerr �word� r �/usr/lib/python3.6/rebol.py� word_callback$ sJ zRebolLexer.word_callbackz[^R]+z REBOL\s+\[�script�Rz\s+z#"�charz#\{[0-9a-f]*\}z2#\{�bin2z64#\{[0-9a-z+/=\s]*\}�"�stringz\{�string2z;#+.*\nz;\*+.*\nz;.*\nz%"� stringFilez%[^(^{")\s\[\]]+z[+-]?([a-z]{1,3})?\$\d+(\.\d+)?z[+-]?\d+\:\d+(\:\d+)?(\.\d+)?zJ\d+[\-/][0-9a-z]+[\-/]\d+(\/\d+\:\d+((\:\d+)?([.\d+]?([+-]?\d+:\d+)?)?)?)?z\d+(\.\d+)+\.\d+z\d+X\d+z#[+-]?\d+(\'\d+)?([.,]\d*)?E[+-]?\d+z[+-]?\d+(\'\d+)?[.,]\d*z[+-]?\d+(\'\d+)?z[\[\]()]z [a-z]+[^(^{"\s:)]*://[^(^{"\s)]*z mailto:[^(^{"@\s)]+@[^(^{"@\s)]+z[^(^{"@\s)]+@[^(^{"@\s)]+z comment\s"�commentString1zcomment\s\{�commentString2zcomment\s\[�commentBlockzcomment\s[^(\s{"\[]+z/[^(^{")\s/[\]]*z"([^(^{")\s/[\]]+)(?=[:({"\s/\[\]])z <[\w:.-]*>z<[^(<>\s")]+�tagz ([^(^{")\s]+)z[^(^")]+z[(|)]+z\^.z#popz [^(^{})]+z#pushz\}z\^."z."� tagStringz [^(<>\r\n")]+�>z(\d+\.)+z\d+z([01]\s*){8}z\[z\]z[^(\[\]"{)]+) �rootr"