U Dx` @sdZddlmZmZddlZddlZdZedZe dZ e dZ edd d d Z Gd d d e ZdddZdddZddZdS)zUtility.)wraps lru_cacheNz(?:\r\n|(?!\r\n)[\n\r])|$AZi)maxsizecCsNg}|D]:}t|}|t|kr,tkr._decorator.._func)r)r2r4r3r,)r2r _decorator2szdeprecated.._decoratorr)r3r,r6rr5r deprecated+s r7cCstj|t|ddS)zWarn deprecated.r*N)r-r.r/r5rrrwarn_deprecated?s r8c Cs(d}d}d}g}d}t|D]}|||d}t|ds`t|s`d} d} ||d}nR||krz|dkrnn,d} ||dkrdndd} ||d}nd} d} t|r|d |d | || dk r|d |d || d |}|d7}|d}qd|||fS) zGet the pattern context.rrr z--> z N z{}{} ^) RE_PATTERN_LINE_SPLITfinditerstartlengroupendr rr) r r!last current_linertextrmZlinetextindentoffsetrrrrIs6    r)r))r))r' functoolsrrr-reDEBUGcompiler>r r r r Exceptionrr7r8rrrrrs