mirror of
https://github.com/personamanagmentlayer/pcl.git
synced 2026-09-14 15:40:22 +08:00
b588247428
Enhanced the semantic analyzer with comprehensive error reporting: - Rich error messages with code snippets showing the exact location - Quick-fix suggestions for all Phase 1.0A and 1.0B validation errors - Proper error codes for all semantic validation errors Key improvements: - Enhanced AnalyzerOptions to accept sourceCode parameter - Created formatErrorWithContext() method to generate rich error messages - Updated error() and warning() methods to support suggestions and error codes - Updated compile() function to pass source code to analyzer Error messages now include: - Error description with context - File path and line:column location - Source code snippet with visual pointer (^) - Actionable quick-fix suggestions Examples of suggestions added: - Duplicate members: "Remove the duplicate occurrence of 'X' from the members list" - Invalid primary: "Add 'X' to the members list, or choose from: A, B, C" - Quorum errors: "Change quorum to at most N/M, or add more team members" - Conflict order: "Add all members to conflict order, e.g.: A > B > C" - Unreachable code: "Remove the branch or change condition to dynamic expression" - Infinite loops: "Use a dynamic condition or 'loop N times' for bounded iteration" All 13/15 validation tests still passing. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>