Add colored parentheses and compact mode module with compiler directive activation #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a new enhanced output module that provides colored parentheses and compact mode functionality for the Lambda Calculus Interpreter. The module can be activated via compiler directives without modifying any existing source files.
Features
🎨 Colored Parentheses
📦 Compact Mode
(λx.(x)) ybecomes(λx.x) y🔧 Drop-in Replacement
The module acts as a complete drop-in replacement that can be enabled entirely through compiler flags:
Implementation
The module provides four operation modes:
When enabled, existing
expr_to_buffer()calls are automatically replaced with enhanced versions through preprocessor macros, requiring zero code changes.Files Added
include/enhanced_output.h- Core interface definitionssrc/enhanced_output.c- Implementation of colored and compact formattinginclude/enhanced_wrapper.h- Drop-in replacement wrapper with macrostest/test_enhanced_simple.c- Comprehensive test suiteENHANCED_OUTPUT_README.md- Complete usage documentationMakefile.enhanced- Additional build targetsExample Output
Before (standard):
After (colored + compact):
The module maintains complete backward compatibility and has zero performance impact when disabled.
Fixes #11.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.