When the REPL lexer encountered a backslash as the last character of input, it would unconditionally call advance() and consume past the token boundary, producing a token with an invalid length. This caused a crash when the token was later printed. The fix adds an isAtEnd guard before advancing, matching the pattern already used for the percent escape handler.
Remove the i386 architecture from the libuv xcodebuild command in
util/build_libuv.py to eliminate deprecation warnings from XCode.
Update the Travis CI configuration to drop the ci_32 build target,
leaving only ci_64 for macOS builds. Also add XCBuildData cache
directory to .gitignore.
The previous formula `vm->bytesAllocated * (100 + heapGrowthPercent) / 100` could overflow on 32-bit systems when `bytesAllocated` was large, causing `nextGC` to wrap below the current allocation and trigger endless garbage collection cycles. Changed to `bytesAllocated + (bytesAllocated * heapGrowthPercent / 100)` which avoids the overflow by computing the growth increment separately and adding it to the base allocation.
Add Travis CI configuration to build and test Wren on both Linux and macOS, for both 32-bit and 64-bit architectures, with and without WREN_NAN_TAGGING defined. Introduce `ci_32` and `ci_64` make targets that build debug/release and C/C++ variants, then run the test suite against each binary using a suffix parameter. Update `util/test.py` with argparse to accept `--suffix` and `suite` arguments, increase test timeout from 2 to 5 seconds, and fix handle leak in `test/api/slots.c` by moving `wrenReleaseHandle` after the conditional block. Replace `fpclassify`/`signbit` checks for infinity/nan in `wrenNumToString` to avoid GCC overflow warnings on 32-bit, double-cast `double` to `uint32_t` in `num_bitwiseNot` to prevent undefined behavior, and relax floating-point comparisons in `test/core/number/sin.wren` and `cos.wren` to use absolute tolerance. Comment out hex literals larger than `0x1000000` in `example/syntax.wren` since they exceed 32-bit range, and bump libuv from v1.8.0 to v1.10.0 for 32-bit build fixes.
The previous formula `vm->bytesAllocated * (100 + heapGrowthPercent) / 100` incorrectly computed the total heap size instead of the additional allocation threshold, causing the GC to trigger endlessly when `bytesAllocated` already exceeded the calculated `nextGC` value. The fix changes the calculation to `bytesAllocated + (bytesAllocated * heapGrowthPercent / 100)`, which properly represents the next collection point as the current allocation plus a growth allowance. This resolves the infinite GC loop observed in `test/language/deeply_nested_gc.wren` on 32-bit architectures.
The previous recursive `wrenMarkObj` approach could overflow the C stack when marking deeply nested object graphs. This commit introduces an iterative two-phase collector: objects are first "grayed" onto an explicit stack in the WrenVM struct, then `wrenDarkenObjs` iteratively processes the gray stack until all reachable objects are marked as "dark". The `marked` field is renamed to `isDark` to reflect the new semantics. A `gray` array with `grayDepth` and `maxGray` tracking is added to `WrenVM`, initialized in `initializeGC` and freed in `wrenFreeVM`. All internal mark calls (`markClass`, `markClosure`, `markFiber`, `wrenCollectGarbage`) are updated to use `wrenGrayObj` instead of `wrenMarkObj`. Two new test files (`deeply_nested_gc.wren` and `many_reallocations.wren`) verify that deeply nested object graphs and repeated GC cycles complete without stack overflow.
Append a new contributor entry for Will Speak with their email address
to the project's AUTHORS file, following the existing formatting
convention used for other contributors.
Extend the compiler's string parser to handle `\U` escapes with 8 hex digits
for codepoints above U+FFFF, replacing the previous TODO comment. The
`readUnicodeEscape` helper now accepts a variable digit count (4 or 8) and
the `readString` function dispatches `\u` with length 4 and `\U` with length 8.
New test cases verify correct encoding of emoji and ancient scripts, plus
error handling for incomplete long escapes and values that fit in 4 digits.