AlkantarClanX12
Current Path : /proc/self/root/opt/alt/python35/lib64/python3.5/idlelib/__pycache__/ |
Current File : //proc/self/root/opt/alt/python35/lib64/python3.5/idlelib/__pycache__/PyParse.cpython-35.pyc |
��Yf�O � @ s d d l Z d d l Z d d l m Z e d � \ Z Z Z Z Z e j d e j e j B� j Z e j d e j � j Z e j d e j e j B� j Z e j d e j � j Z e j d e j � j Z e j d e j � j Z Gd d � d e � Z Gd d � d � Z d S)� N)�Mapping� z� ^ [ \t]* (?: while | else | def | return | assert | break | class | continue | elif | try | except | raise | import | yield ) \b z' [ \t]* (?: \# \S .* )? \n aK \""" [^"\\]* (?: (?: \\. | "(?!"") ) [^"\\]* )* (?: \""" )? | " [^"\\\n]* (?: \\. [^"\\\n]* )* "? | ''' [^'\\]* (?: (?: \\. | '(?!'') ) [^'\\]* )* (?: ''' )? | ' [^'\\\n]* (?: \\. [^'\\\n]* )* '? zM [ \t]* [^\s#\\] # if we match, m.end()-1 is the interesting char z_ \s* (?: return | break | continue | raise | pass ) \b z [^[\](){}#'"\\]+ c @ sU e Z d Z d Z d d � Z d d � Z d d � Z d d � Z d d d � Z d S) �StringTranslatePseudoMappingaT Utility class to be used with str.translate() This Mapping class wraps a given dict. When a value for a key is requested via __getitem__() or get(), the key is looked up in the given dict. If found there, the value from the dict is returned. Otherwise, the default value given upon initialization is returned. This allows using str.translate() to make some replacements, and to replace all characters for which no replacement was specified with a given character instead of leaving them as-is. For example, to replace everything except whitespace with 'x': >>> whitespace_chars = ' \t\n\r' >>> preserve_dict = {ord(c): ord(c) for c in whitespace_chars} >>> mapping = StringTranslatePseudoMapping(preserve_dict, ord('x')) >>> text = "a + b\tc\nd" >>> text.translate(mapping) 'x x x\tx\nx' c C s4 | | _ | | _ | j | d d � } | | _ d S)Nc S s | | | � S)N� )�key�_getZ_defaultr r �4/opt/alt/python35/lib64/python3.5/idlelib/PyParse.pyr y s z3StringTranslatePseudoMapping.__init__.<locals>._get)� _non_defaultsZ_default_value�getr )�selfZnon_defaults� default_valuer r r r �__init__u s z%StringTranslatePseudoMapping.__init__c C s | j | � S)N)r )r �itemr r r �__getitem__} s z(StringTranslatePseudoMapping.__getitem__c C s t | j � S)N)�lenr )r r r r �__len__� s z$StringTranslatePseudoMapping.__len__c C s t | j � S)N)�iterr )r r r r �__iter__� s z%StringTranslatePseudoMapping.__iter__Nc C s | j | � S)N)r )r r �defaultr r r r � s z StringTranslatePseudoMapping.get) �__name__� __module__�__qualname__�__doc__r r r r r r r r r r ` s r c @ sB e Z d Z d d � Z d d � Z d e d d � Z d d � Z i Z e j d d � d D� � e j d d � d D� � e j d d � d D� � e e d e d � �Z d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z d! d"