Message193395
Further changes should be aimed at actual idlelib uses. Wordstart and wordend are used once each in AutoExpand.py (and wordstart a couple of times for tag.start positions). So forget them.
Does idlelib really have indexes like "2.3 + 1c" ('2.4'), "2.3-1c" ('2.2'), and "22.33-1chars" ('22.32')?
The grammar we need to parse is something like
index := base modifier* # nearly always 0, 1, few 2, one 3 times, so
index := base modifier{0:3}
index := base modmaybe modmaybe modmaybe
base := numpair | mark
numpair := int '.' ( int | 'end' )
mark := 'end' | 'insert' | 'iomark' | 'my_anchor'
| 'sel.first' | sel.last # parts tags but this should work
modmaybe := modifier | ''
modifier := ' linestart' | ' lineend' | incr
incr := ' '* ('+' | '-') ' '* int ('c' | 'line')
# Could change the one 'char' to 'c'
Rather than parse an entire index at once, parse, interpret as position, and remove base from input. While remainder, parse, apply to position, and remove from remainder. Whether the parsing is done with base and modifier REs with groups or code or some mixture does not much matter. |
|
Date |
User |
Action |
Args |
2013-07-20 02:31:42 | terry.reedy | set | recipients:
+ terry.reedy, JayKrish |
2013-07-20 02:31:42 | terry.reedy | set | messageid: <1374287502.04.0.411723271756.issue18504@psf.upfronthosting.co.za> |
2013-07-20 02:31:41 | terry.reedy | link | issue18504 messages |
2013-07-20 02:31:41 | terry.reedy | create | |
|