47 lines
1.7 KiB
Bash
Executable File
47 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
echo "🚀 Nyash Phase 8.4 AST→MIR Lowering Demonstration"
|
|
echo "=================================================="
|
|
|
|
echo ""
|
|
echo "✅ Test 1: Basic User-Defined Box (Previously Failed)"
|
|
echo "------------------------------------------------------"
|
|
echo "Code: box DataBox { init { value } }"
|
|
echo " local obj = new DataBox(42)"
|
|
echo " return obj.value"
|
|
echo ""
|
|
./target/debug/nyash --dump-mir test_user_defined_box.nyash 2>/dev/null | tail -8
|
|
|
|
echo ""
|
|
echo "✅ Test 2: Method Calls (Previously Failed)"
|
|
echo "--------------------------------------------"
|
|
echo "Code: c.increment() // Method call on user-defined box"
|
|
echo ""
|
|
./target/debug/nyash --dump-mir test_field_operations.nyash 2>/dev/null | tail -8
|
|
|
|
echo ""
|
|
echo "✅ Test 3: Delegation Syntax (Previously Failed)"
|
|
echo "-------------------------------------------------"
|
|
echo "Code: from Parent.greet() // Delegation call"
|
|
echo ""
|
|
./target/debug/nyash --dump-mir test_delegation_basic.nyash 2>/dev/null | tail -8
|
|
|
|
echo ""
|
|
echo "✅ Test 4: Static Main Compatibility (Preserved)"
|
|
echo "------------------------------------------------"
|
|
echo "Code: static box Main { main() { return 42 } }"
|
|
echo ""
|
|
./target/debug/nyash --dump-mir test_static_main_compatibility.nyash 2>/dev/null | tail -6
|
|
|
|
echo ""
|
|
echo "🎯 Summary: AST→MIR Lowering for Everything is Box"
|
|
echo "=================================================="
|
|
echo "• User-defined boxes: ✅ Working"
|
|
echo "• Object creation: ✅ Working (RefNew)"
|
|
echo "• Field access: ✅ Working (RefGet)"
|
|
echo "• Method calls: ✅ Working (BoxCall)"
|
|
echo "• Delegation: ✅ Working (from calls)"
|
|
echo "• me references: ✅ Working"
|
|
echo "• Static Main: ✅ Preserved"
|
|
echo ""
|
|
echo "🚀 Phase 8.3 WASM Box operations can now be tested!" |