teeemcee
2024-01-07 02:24:58 -0800 (Sun, 07 Jan 2024)
812
Fix range checking bugs in "insert extra", "delete extra", "delete extra range"

-all three proceeded even if the handle (first arg) was invalid. If it wasn't
 they would likely crash, after first showing a script error.
-"delete extra range" didn't check start <= end, if not v_delete_slice would
 throw a BUG
-"delete extra (obj, -1)" threw an error
-"delete extra range" was documented to return the first element in the range
 but didn't. (Admittedly, not very useful.) Added tests.

Also "delete extra range" didn't allow deleting the empty range [len, len)
although v_delete_slice allows it. I wanted that, and to simplify the code I
decided to allow all empty ranges [i, i) even if i is invalid. I'm surprised to
see Python never raises an error when deleting an invalid array range, it just
does nothing.
---
U   wip/common.bi
U   wip/common.rbas
U   wip/scriptcommands.bas
U   wip/testgame/autotest.hss
U   wip/testgame/autotest.rpgdir/general.reld
U   wip/testgame/autotest.rpgdir/ohrrpgce.hsp
U   wip/testgame/autotest.rpgdir/plotscr.lst

_______________________________________________
Ohrrpgce mailing list
ohrrpgce@lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to