Files
hakorune/local_tests/test_phase_9_78e_methods.nyash
Moe Charm 5582ad45c0 feat: Phase 9.78e complete - instance_v2 migration with legacy compatibility
- instance_v2 now includes legacy compatibility layer
- All interpreter code migrated to use instance_v2
- Added legacy field access methods (get_fields, set_field_legacy, etc.)
- Fixed type conversion issues (NyashValue vs SharedNyashBox)
- instance.rs still exists but no longer used in interpreter
- TODO: Remove instance.rs completely in next phase
- TODO: Implement proper SharedNyashBox -> NyashValue conversion

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-19 22:35:34 +09:00

46 lines
944 B
Plaintext

// Phase 9.78e test - Method calls on StringBox through InstanceBox
local str
str = new StringBox("Hello, Nyash!")
print("Created StringBox: " + str)
// Test basic methods that should work with call_method
local len
len = str.length()
print("Length: " + len)
local upper
upper = str.toUpperCase()
print("Uppercase: " + upper)
local lower
lower = str.toLowerCase()
print("Lowercase: " + lower)
local trimmed
trimmed = str.trim()
print("Trimmed: " + trimmed)
// Test methods with arguments
local index
index = str.indexOf("Nyash")
print("Index of 'Nyash': " + index)
local replaced
replaced = str.replace("Hello", "Hi")
print("Replaced: " + replaced)
local char
char = str.charAt(0)
print("First character: " + char)
local substr
substr = str.substring(0, 5)
print("Substring(0,5): " + substr)
// Test concatenation
local concat
concat = str.concat(" How are you?")
print("Concatenated: " + concat)
print("All method tests completed!")