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:
@@ -0,0 +1,2 @@
|
||||
var a = "123"
|
||||
a[1...4] // expect runtime error: Range end out of bounds.
|
||||
Reference in New Issue
Block a user