feat: add range subscripting support for strings with CalculatedRange helper

Extract range validation logic from list_subscript into a reusable calculateRange function that handles inclusive/exclusive bounds, negative indices, and direction stepping. Add CalculatedRange struct to wren_core.h and implement string subscripting via the new helper, including comprehensive test coverage for forward, backward, negative, and half-negative ranges with proper error messages for out-of-bounds and non-integer values.
This commit is contained in:
Gavin Schulz
2015-01-17 07:20:56 +00:00
parent 222cddc751
commit 2799fa6b58
12 changed files with 156 additions and 40 deletions
@@ -0,0 +1,2 @@
var a = "123"
a[-4..2] // expect runtime error: Range start out of bounds.