,GRĂHSSKrSSKrSSKrSSKrSSKJr SSKJr SrSr Sr \ "5r \R"S5r SSSSS .rS rS r"S S \5rSr\S:XaSSKJr \"SSSS9 SSKJr \"\5 gg)N)idleConf) DelegatorFc6SU-SRU5-S-$)z9Return a named group pattern matching list of alternates.z(?P<%s>|))join)name alternatess 8/opt/alt/python313/lib64/python3.13/idlelib/colorizer.pyanyr s t chhz2 2S 88c"S[S[R5-S-nSSRSSSR[R5-S-/5-S-nS nS SRS SSSR[R5-S-/5-S-n[ [ 5Vs/sH<nUR S 5(aMU[R;dM1[U5PM> nnS [SU5-S-n[SS/5nSnUS-n US-n US-n US-n [SXX/5n [R"SRXgXXU[SS/5/5[R[R-5nU$s snf)Nz\bKEYWORDz,^[ \t]*(?Pmatch)\b(?![ \t]*(?:rz[:,;=^&|@~)\]}]z\b(?:z)\bz))zB^[ \t]*(?Pcase)[ \t]+(?P_\b)z+^[ \t]*(?Pcase)\b(?![ \t]*(?:z_\b_z([^.'\"\\#]\b|^)BUILTINCOMMENTz#[^\n]*z(?i:r|u|f|fr|rf|b|br|rb)?z'[^'\\\n]*(\\.[^'\\\n]*)*'?z"[^"\\\n]*(\\.[^"\\\n]*)*"?z''''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?z'"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?STRINGSYNCz\n) r keywordkwlistrdirbuiltins startswithstrrecompileDOTALL MULTILINE)kw match_softkw case_defaultcase_softkw_and_patternr builtinlistbuiltincomment stringprefixsqstringdqstring sq3string dq3stringstringprogs r make_patr-s Y/ /% 7B ((  tyy0 06 9$      2  ((   tyy0 06 9 $     *-X///#.w~~-3t9K/"C ;$??%GG)j\*G/L<# UHupU(dMX4v M g7fN).0kvs r 'matched_named_groups..Ns C!=vFQF!=s  ) groupdictitems)re_matchs r matched_named_groupsr>Ls C!3!3!5!;!;!= CCr c [R"5n[R"US5n[R"US5Sn[R"US5nURUSUSUUSUSUSS9 g)z[Set color options of Text widget. If ColorDelegator is used, this should be called first. normalcursor foregroundhilite background)rBrDinsertbackgroundselectforegroundselectbackgroundinactiveselectbackgroundN)r CurrentTheme GetHighlightconfig)texttheme normal_colors cursor_color select_colorss r color_configrQQs  ! ! #E))%:M((9,GL))%:MKK . .%&|4&|4!.|!<  r c\rSrSrSrSrSrSrSrSr SS jr SS jr SS jr S r SS jrSrSrSrSrSrSrg)ColorDelegatorfaDelegator 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[R"U5 UR5 [Ul[UlUR 5 gr4)r__init__ init_stater,idprog LoadTagDefsselfs r rVColorDelegator.__init__vs44     r c<SUlSUlSUlSUlg)z1Initialize variables that track colorizing state.NTF)after_idallow_colorizingstop_colorizing colorizingrZs r rWColorDelegator.init_state}s  $$r c URbURS5 [R"X5 Ub?UR 5 UR SUR 5 URSS5 gSUlSUl g)aJSet the delegate for this instance. A delegate is an instance of a Delegator class and each delegate points to the next delegator in the stack. This allows multiple delegators to be chained together for a widget. The bottom delegate for a colorizer is a Text widget. If there is a delegate, also start the colorizing process. Nz<>1.0endTF) delegateunbindr setdelegate config_colorsbindtoggle_colorize_event notify_ranger`r_)r[rfs r rhColorDelegator.setdelegatesr == $ KK2 3d-      II0$2L2L M   eU +$(D $)D !r cURR5HupUR"U40UD6 M URS5 g)z4Configure text widget tags with colors from tagdefs.selN)tagdefsr< tag_configure tag_raise)r[tagcnfs r riColorDelegator.config_colorss: **,HC   s *c *- ur c [R"5n[R"US5[R"US5[R"US5[R"US5[R"US5SSS.SSS.[R"US5[R"US 5S . Ul[(a[ S UR5 gg) z.Create dictionary of tag names to text colors.r%rr$r+ definitionN)rDrBerrorhit) rrrr DEFINITIONrTODOERRORryrp)rrIrJrpDEBUGprint)r[rMs r rYColorDelegator.LoadTagDefss%%',,UI>,,UI>,,UI>++E8<"//|D#'t<#'t<**5': ((6  5% 4<<05r NcURU5nURRXU5 URXS[ U5--5 g)z:Insert chars into widget at index and mark for colorizing.z+%dcN)indexrfinsertrllen)r[rcharstagss r rColorDelegator.inserts@ 5! U40 %#e*)!$EDEDLBzz$)>)5*6#67"sL%((););= SvQuQiq)vQs1gQ' )r c^URRU5Hn[U5H|upEURU5upgUR XgX$5 US;dM2UR R X5=n(dMVURS5upgUR XgUS5 M~ M g)zParse and add highlighting tags to a given part of the text. `chars` is a string with the text to parse and to which highlighting is to be applied. `head` is the index in the text widget where the text is found. )defclassrrzN)r,finditerr>spanrrXmatch) r[rrmr matched_textabm1s r r#ColorDelegator._add_tags_in_sectionOs##E*A&:1&="vvd| aD/#33![[..u88r8!wwqz aD,? '>+r cPURHnURUSS5 M g)zRemove all colorizing tags.rdreN)rpr)r[rss r removecolorsColorDelegator.removecolors`s < " $0 ;D*X)"@"/r rScSSKJnJn SSKJn SSKJn U"U5nURS5 [[UR5RS5SS5upgURSUS -US -4-5 U"US S 9nURSS S9 URSU5 UR5 [U5 U"U5n [!5n U R#U 5 g)Nr)ToplevelText)source) PercolatorzTest ColorDelegatorrrz 700x550+%d+%dwhite)rDboth)expandfillr)tkinterrr idlelib.idle_test.test_colorizerridlelib.percolatorrtitlemapintgeometrysplitpackr focus_setrQrS insertfilter) parentrrrrtopxyrLprs r _color_delegatorrfs&7- 6 CII#$ sFOO%++C04 5DALLAFAG#445  (DIIQVI$KK&!NN4AANN1r __main__)mainz idlelib.idle_test.test_colorizerr) verbosityexit)run)rrrridlelib.configridlelib.delegatorrr}r r-r,rrXrr>rQrSrrunittestridlelib.idle_test.htestrr5r r rs #' 9 .bz K ( D  *}/Y}/@* z +quE+ r