#!/usr/bin/env python3

import sys
import os

# Add the src directory to the Python path
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'src'))

from alloy.parser import AlloyParser
from alloy.lexer import AlloyLexer

def debug_conflict():
    
    # Create a parser with debug enabled
    lexer = AlloyLexer()
    parser = AlloyParser(lexer)
    
    # Test the specific failing case
    code = '''csv_data = cleaned_data
raw_data = "sales_csv_data"'''
    
    print("=== Debugging specific conflict ===")
    print(repr(code))
    
    try:
        # Parse with debug enabled
        ast = parser.parse(code, debug=True)
        print("AST:", ast)
    except Exception as e:
        print(f"PARSER ERROR: {e}")
        import traceback
        traceback.print_exc()

if __name__ == "__main__":
    debug_conflict()