+
     Bi<                     R   R t RRRRRRRRRRRR	R
RRRRRRRRR/t/ RRbRRbRRbRRbRRbRR	bRRbRRbRRbRRbRRbRRbR R bR!R!bR"R"bR#R#bR$R$b/ R%R%bR&R&bR'R'bR(R(bR)R)bR*R*bR+R+bR,R,bR-R-bR.R.bR/R/bR0R0bR1R1bR2R2bR3RbR4R4bR5R6bCR7RR8R8/Ct ! R9 R:]4      tR; R< ltR= R> ltRAR? ltR@# )Ban  
Keymap contains functions for parsing keyspecs and turning keyspecs into
appropriate sequences.

A keyspec is a string representing a sequence of key presses that can
be bound to a command. All characters other than the backslash represent
themselves. In the traditional manner, a backslash introduces an escape
sequence.

pyrepl uses its own keyspec format that is meant to be a strict superset of
readline's KEYSEQ format. This means that if a spec is found that readline
accepts that this doesn't, it should be logged as a bug. Note that this means
we're using the '\C-o' style of readline's keyspec, not the 'Control-o' sort.

The extension to readline is that the sequence \<KEY> denotes the
sequence of characters produced by hitting KEY.

Examples:
'a'      - what you get when you hit the 'a' key
'\EOA'  - Escape - O - A (up, on my terminal)
'\<UP>' - the up arrow key
'\<up>' - ditto (keynames are case-insensitive)
'\C-o', '\c-o'  - control-o
'\M-.'  - meta-period
'\E.'   - ditto (that's how meta works for pyrepl)
'\<tab>', '\<TAB>', '\t', '\011', '\x09', '\X09', '\C-i', '\C-I'
   - all of these are the tab character.
\'"abefn
rt	v	backspacedeletedownendenterescapef1f2f3f4f5f6f7f8f9f10f11f12f13f14f15f16f17f18f19f20homeinsertleftz	page downzpage upreturnrightspace tabupc                       ] tR t^htRtR# )KeySpecError N)__name__
__module____qualname____firstlineno____static_attributes__r:       %/usr/lib/python3.14/_pyrepl/keymap.pyr9   r9   h   s    r@   r9   c                F    V ^8  d   QhR\         R\        \         ,          /# )   keysr2   )strlist)formats   "rA   __annotate__rH   l   s      S T#Y r@   c                n    ^ p. pV\        V 4      8  d!   \        W4      w  r1VP                  V4       K0  V# )z3Parse keys in keyspec format to a sequence of keys.)len_parse_single_key_sequenceextend)rD   sr   ks   &   rA   
parse_keysrO   l   s3    	AA
c$i-)$2	Hr@   c                t    V ^8  d   QhR\         R\        R\        \        \         ,          \        3,          /# )rC   keyrM   r2   )rE   inttuplerF   )rG   s   "rA   rH   rH   v   s3     L LC LC LE$s)S.4I Lr@   c                 |   ^ p^ pRpV'       Eg   V\        V 4      8  Ed   W,          R8X  Ed   W^,           ,          P                  4       pV\        9   d   \        V,          pV^,          pKh  VR8X  dr   W^,           ,          R8w  d%   \        RV^,           \	        V 4      3,          4      hV'       d%   \        RV^,           \	        V 4      3,          4      h^pV^,          pK  VR8X  ds   W^,           ,          R8w  d%   \        RV^,           \	        V 4      3,          4      hV'       d%   \        R	V^,           \	        V 4      3,          4      h^pV^,          pEKY  VP                  4       '       d4   W^,           V^,            p\        \        V^4      4      pV^,          pEK  VR
8X  d4   W^,           V^,            p\        \        V^4      4      pV^,          pEK  VR8X  d   V P                  RV4      pVR8X  d%   \        RV^,           \	        V 4      3,          4      hW^,           V P                  4       pV\        9  d%   \        RWA^,           \	        V 4      3,          4      h\        V,          pV^,           pEK  \        R\	        V4      V^,           \	        V 4      3,          4      hW,          pV^,          pEK  V'       dE   \        V4      ^8X  d   \        \        V4      ^,          4      pMVR9   d   RV 2pM\        R4      hV.V3pV'       d   V^ ,          P                  ^ R4       V# )     r   c-z*\C must be followed by `-' (char %d of %s)zdoubled \C- (char %d of %s)mz*\M must be followed by `-' (char %d of %s)zdoubled \M- (char %d of %s)x<>z)unterminated \< starting at char %d of %sz*unrecognised keyname `%s' at char %d of %sz,unknown backslash escape %s at char %d of %szctrl z\C- followed by invalid keyr
   >   r1   r3   )rJ   lower_escapesr9   reprisdigitchrrR   find	_keynamesordr0   )	rQ   rM   ctrlmetaretrW   r   r   results	   &&       rA   rK   rK   v   s   DD
Cca#c(l6T>E
  "AH}qkQc1u:$&Eq5$s),-  &6!a%c9KK  Qc1u:$&Eq5$s),-  &6!a%c9KK  QAA&#a)nQcAA&#a*oQcHHS!$7&Dq5$s),-  a%!n**,i'&DAtCy12   nE"BAwAtCy12 
 &CFAs8q=c#ho&C%%#-C=>>UAXFq	F#Mr@   c                    / pV P                  4        FI  w  r4\        V\        4      '       d   VR ,          pM	V^ ,          pWBP                  V/ 4      VR,          &   KK  	  VP                  4        FR  w  r4W9   d;   \	        V4      ^8w  d   \        RVP                  4       : R24      hWA,          W#&   KE  \        WA4      W#&   KT  	  V# ):N   N:rk   NNzkey definitions for z clash)items
isinstancebytes
setdefaultrJ   r9   valuescompile_keymap)keymapemptyr   rQ   valuefirsts   &&    rA   rq   rq      s    
Alln
c5!!GEFE+0UBB( % ggi
>5zQ"U\\^#UVV#E1AF   Hr@   N)r@   )__doc__r_   rd   	Exceptionr9   rO   rK   rq   r:   r@   rA   <module>rx      s  *< 	$%%h% F% 
5	%
 T% f% 	$% 	$% 	$% 	$% 	$% 	$% 	$% 	$% 	$%  
5!%" 
5#%$ 
5%%& 
5'%( 
5)%* 
5+%, 
5-%. 
5/%0 
51%2 
53%4 
55%6 F7%8 h9%: F;%< =%> y?%@ dA%B WC%D SE%F 
4$I%	P	9 	L^r@   