8f dZddlZddlmZddlmZddlmZddlmZej dZ edZ dZ d Z d d ZdS) a pygments.regexopt ~~~~~~~~~~~~~~~~~ An algorithm that generates optimized regexes for matching long lists of literal strings. :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. N)escape) commonprefix)groupby) itemgetterz [\[\^\\\-\]]cldtdd|zdzS)N[c0d|zS)N\)group)ms }/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_vendor/pygments/regexopt.pyzmake_charset..s )9]) CS_ESCAPEsubjoin)letterss r make_charsetrs0 992777;K;KLL Ls RRrc  |rdpd}|sdS|d t|dkr|t z|zS s!|t|dddzdz|zSt dkrg}g}|D]@}t|dkr||+||At|dkr@|r)|t|dzdzt |z|zS|t |z|zSt |}|rAt| |t|zt fd |Ddz|zSd |D}t |}|rWt| |tt fd |Ddzt|ddd z|zS|dd t| fdDz|zS)zEReturn a regex that matches any string in the sorted list of strings.)rrNz(?:?|c$g|] }|d SN).0splens r z#regex_opt_inner..?s!999Aqx999rc$g|] }|dddS)Nr)rr s r r"z#regex_opt_inner..Bs",,,q1TTrT7,,,rc3.K|]}|d VdSrr)rr slens r z"regex_opt_inner..Hs-$@$@1QvvY$@$@$@$@$@$@rr$c3\K|]'}tt|ddV(dS)rrN)regex_opt_innerlist)rr s r r'z"regex_opt_inner..MsRLL!eAh44LLLLLLrc(|ddkS)Nrr)r firsts r rz!regex_opt_inner..Ns1q9Ir) lenrr)appendrrsortedrr) strings open_paren close_paren oneletterrestr prefix strings_revsuffixr,r!r&s @@@r r)r)s$*K r AJE 7||qF5MM)K77  OGABBK???   5zzQ   A1vv{{  #### A y>>A   <!OD"$=$==C"9--.0;<< Y 7 77+E E ' " "F 6{{F6NN*99999995AAB -,G,,,K + & &F 16{{f$@$@$@$@$@$@$@@@%HHIVDDbD\""#%01 1  LL%g/I/I/I/IJJLLL L L L  rrcLt|}|t|dz|zS)zReturn a compiled regex that matches any string in the given list. The strings to match must be literal strings, not regexes. They will be regex-escaped. *prefix* and *suffix* are pre- and appended to the final regex. ()r/r))r0r5r7s r regex_optr:Rs)WooG OGS11 1F ::r)rr)__doc__reros.pathr itertoolsroperatorrcompiler FIRST_ELEMENTrr)r:rrr rBs     BJ ' '  1 SSS555p ; ; ; ; ; ;r