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.
3 lines
84 B
Plaintext
3 lines
84 B
Plaintext
var a = "string"
|
|
a[1.5..2] // expect runtime error: Range start must be an integer.
|