mò %U²Ic@s\dkZdkTdZdadZd„Zd„Zd„Zd„Zd„Z d „Z dS( N(t*iicGstt||ƒS(N(tggreptRE_SYNTAX_GREPtpattfiles(RR((t)/data/zmath/lib/python2.4/lib-old/grep.pytgrep scGstt||ƒS(N(RtRE_SYNTAX_EGREPRR(RR((Rtegrep scGstt||ƒS(N(RtRE_SYNTAX_EMACSRR(RR((RtemgrepscCst|ƒdjo+t|dƒtgƒjo|d}nt|ƒdjati|ƒ}zti|ƒ}Wdti|ƒ}Xx„|D]|}t |dƒ}d}xT|iƒ}|pPn|d}|i|ƒdjot||||ƒqªqªW|iƒqŒWdS(Niitr(tlenRttypetopt_show_filenametregext set_syntaxtsyntaxtcompileRtprogtfilenametopentfptlinenotreadlinetlinetsearchtshowlinetclose(RRRRRRRR((RRs,0  cGsít|ƒdjo+t|dƒtgƒjo|d}nt|ƒdjadk}|i|ƒ}x~|D]v}t |dƒ}d}xN|i ƒ}|pPn|d}|i|ƒot||||ƒqqW|iƒqoWdS(NiiR (R RR RtreRRRRRRRRRRRR(RRRRRRRR((Rtpgrep(s&0   cCs.|ddjo|d }nto| idƒd}nd}to|d|}n||GHto½|i ƒd\}}|| }d|jodt |ƒ|}nCdt |ƒ}x/|D]'}|djo d}n||}qÉW||jo|d }n|d ||}|GHndS( Niÿÿÿÿs is: tis t s\t^(Rtopt_show_linenoRtrjusttprefixRRtopt_show_whereRtregststarttendR tc(RRRRR)R(R'R$((RR:s.     ( Rt regex_syntaxR%RR"RRR RRR( RRR R"RRRRR%((Rt?s