#!/usr/bin/env python3

print("🚀 Simple Alloy Test")
print("=" * 30)

try:
    # Test imports
    import ply.lex as lex
    import ply.yacc as yacc
    print("✅ PLY imports successful")
    
    # Test our interpreter import
    from alloy_interpreter import parser, Interpreter
    print("✅ Alloy interpreter import successful")
    
    # Test basic parsing
    simple_code = "x = 42"
    ast = parser.parse(simple_code)
    print(f"✅ Simple parsing successful: {simple_code}")
    
    # Test basic interpretation
    interpreter = Interpreter()
    interpreter.interpret(ast)
    result = interpreter.global_env.get('x')
    print(f"✅ Simple interpretation successful: x = {result}")
    
    # Test agent parsing (should work with new syntax)
    agent_code = 'claude = agent "claude-3.5-sonnet"'
    agent_ast = parser.parse(agent_code)
    print(f"✅ Agent parsing successful: {agent_code}")
    
    print("\n🎉 All basic tests passed!")
    print("The implementation appears to be working correctly.")
    
except ImportError as e:
    print(f"❌ Import error: {e}")
    print("Make sure PLY is installed: pip install ply")
    
except Exception as e:
    print(f"❌ Error: {e}")
    import traceback
    traceback.print_exc()
    
print("\n" + "=" * 30)
print("Test complete.")