This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients JayKrish, terry.reedy
Date 2013-07-20.02:31:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1374287502.04.0.411723271756.issue18504@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-07-20 02:31:42terry.reedysetrecipients: + terry.reedy, JayKrish
2013-07-20 02:31:42terry.reedysetmessageid: <1374287502.04.0.411723271756.issue18504@psf.upfronthosting.co.za>
2013-07-20 02:31:41terry.reedylinkissue18504 messages
2013-07-20 02:31:41terry.reedycreate