Sindbad~EG File Manager
�
%Μg�9 � � � d dl Z d dlZd dlZd dlZd dlmZ d dlmZ dZd� Z d� Z
e
� Z ej d� Z
ddddd �Zd
� Zd� Z G d� d
e� Zd� Zedk( r d dlmZ eddd�� d dlmZ ee� yy)� N)�idleConf)� DelegatorFc �6 � d| z dj |� z dz S )z9Return a named group pattern matching list of alternates.z(?P<%s>�|�))�join)�name�
alternatess �./usr/local/lib/python3.12/idlelib/colorizer.py�anyr s � ��t��c�h�h�z�2�2�S�8�8� c � � dt dt j � z dz } ddj dddj t j � z dz g� z dz }d }d
dj ddddj t j � z dz g� z dz }t t
� D �cg c]0 }|j
d� s|t j vrt |� ��2 }}d
t d|� z dz }t ddg� }d}|dz } |dz }
|dz }|dz }t d||| |
g� }
t j dj |||
| |||t ddg� g� t j t j z � }|S c c}w )Nz\b�KEYWORDz,^[ \t]*(?P<MATCH_SOFTKW>match)\b(?![ \t]*(?:r z[:,;=^&|@~)\]}]z\b(?:z)\bz))zB^[ \t]*(?P<CASE_SOFTKW>case)[ \t]+(?P<CASE_DEFAULT_UNDERSCORE>_\b)z+^[ \t]*(?P<CASE_SOFTKW2>case)\b(?![ \t]*(?:z_\b�_z([^.'\"\\#]\b|^)�BUILTIN�COMMENTz#[^\n]*z(?i:r|u|f|fr|rf|b|br|rb)?z'[^'\\\n]*(\\.[^'\\\n]*)*'?z"[^"\\\n]*(\\.[^"\\\n]*)*"?z''''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?z'"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?�STRING�SYNCz\n)r �keyword�kwlistr �dir�builtins�
startswith�str�re�compile�DOTALL� MULTILINE)�kw�match_softkw�case_default�case_softkw_and_patternr �builtinlist�builtin�comment�stringprefix�sqstring�dqstring� sq3string� dq3string�string�progs r �make_patr- s� � � ��Y����/� /�%� 7�B� ��(�(���t�y�y����0�0�6�9�$
� � � � � � 2� � ��(�(����t�y�y����0�0�6�9� $
� � � � � � *-�X�� /����/�/�#�.��w�~�~�-� �t�9��K� /� "�C� �;�$?�?�%�G�G��)�j�\�*�G�/�L��<�<�H��<�<�H��I�I�I��I�I�I�
��I�y�(�H�E�
F�F�
�:�:�c�h�h� '��&�"� ,�l� 7� #�F�U�G� 4� !� "� �i�i�"�,�,�.�
0�D� �K��%/s �-5Fz\s+(\w+)r )�MATCH_SOFTKW�CASE_SOFTKW�CASE_DEFAULT_UNDERSCORE�CASE_SOFTKW2c �L � d� | j � j � D � S )z<Get only the non-empty named groups from an re.Match object.c 3 �0 K � | ] \ }}|s� ||f�� � y �w�N� )�.0�k�vs r � <genexpr>z'matched_named_groups.<locals>.<genexpr>N s � �� �C�!=�v��1��Q��F�!=�s �
� )� groupdict�items)�re_matchs r �matched_named_groupsr= L s � �C��!3�!3�!5�!;�!;�!=�C�Cr
c � � t j � }t j |d� }t j |d� d }t j |d� }| j |d |d ||d |d |d �� y)zcSet color options of Text widget.
If ColorDelegator is used, this should be called first.
�normal�cursor�
foreground�hilite�
background)rA rC �insertbackground�selectforeground�selectbackground�inactiveselectbackgroundN)r �CurrentTheme�GetHighlight�config)�text�theme�
normal_colors�cursor_color�
select_colorss r �color_configrP Q s� � �
�!�!�#�E��)�)�%��:�M��(�(���9�,�G�L��)�)�%��:�M��K�K� ��.� ��.�%�&�|�4�&�|�4�!.�|�!<�
�
r
c �r � e Zd ZdZd� Zd� Zd� Zd� Zd� Zdd�Z dd �Z
dd
�Zd� Zdd�Z
d
� Zd� Zd� Zd� Zd� Zy)�ColorDelegatora- Delegator for syntax highlighting (text coloring).
Instance variables:
delegate: Delegator below this one in the stack, meaning the
one this one delegates to.
Used to track state:
after_id: Identifier for scheduled after event, which is a
timer for colorizing the text.
allow_colorizing: Boolean toggle for applying colorizing.
colorizing: Boolean flag when colorizing is in process.
stop_colorizing: Boolean flag to end an active colorizing
process.
c � � t j | � | j � t | _ t | _ | j � y r4 )r �__init__�
init_stater, �idprog�LoadTagDefs��selfs r rT zColorDelegator.__init__v s4 � ����4� ������� �������r
c �<