refactor: replace manual string concatenation with wrenStringFormat across VM core

Replace ad-hoc string construction using wrenNewString, wrenStringConcat, and sprintf with the new wrenStringFormat helper. This centralizes string formatting logic, reduces code duplication, and eliminates manual length calculations in wren_compiler.c, wren_core.c, wren_value.c, and wren_vm.c. Also introduces CONST_STRING macro for compile-time string literals and changes wrenNewUninitializedString return type from Value to ObjString* for consistency.
This commit is contained in:
Bob Nystrom
2015-03-16 05:32:20 +00:00
parent d01173048b
commit 9314cbfd72
6 changed files with 194 additions and 168 deletions
-6
View File
@@ -83,9 +83,3 @@ print(" TODOs " + str(num_test_todos))
print(" expectations " + str(num_expects))
print(" non-empty lines " + str(num_test))
print(" empty lines " + str(num_test_empty))
print("\n")
print("benchmark:")
print(" files " + str(num_benchmark_files))
print(" TODOs " + str(num_benchmark_todos))
print(" non-empty lines " + str(num_benchmark))
print(" empty lines " + str(num_benchmark_empty))