Repository navigation
Z version v0.12.1
Changelog
[0.12.1] - 2024-07-21
馃殌 New Features
1. Pointer Dereferencing Support
- Added pointer dereferencing in PRINT statements: You can now use
PRINT *ptrto dereference and print pointer values - Added pointer dereferencing in MOV assignments: You can now use
MOV dest *ptrto dereference pointers in assignments - Enhanced semantics validation: Added proper validation for pointer dereferencing operations
2. Enhanced Code Generation
- Improved pointer handling: Better code generation for pointer operations
- Enhanced array operations: More robust array handling in generated C code
- Improved error messages: More descriptive error messages for pointer-related operations
馃悰 Bug Fixes
1. Pointer Dereferencing
- Fixed pointer dereferencing in PRINT statements: Previously,
PRINT *ptrwould cause a semantics error - Fixed pointer dereferencing in MOV assignments: Previously,
MOV dest *ptrwas not supported - Fixed semantics analyzer: Added proper handling for pointer dereferencing syntax
2. Fibonacci Calculation
- Fixed FOR loop syntax: Corrected the FOR loop variable initialization issue
- Fixed loop variable scoping: Ensured FOR loop variables are properly declared and initialized
- Fixed Fibonacci algorithm: The Fibonacci sequence now calculates correctly (fib(10) = 55)
3. General Improvements
- Fixed type checking errors: Resolved various type checking issues in the codebase
- Improved code consistency: Enhanced code formatting and organization
- Better error handling: More robust error handling throughout the compiler
馃摎 Documentation Updates
1. Updated Example Code
- Comprehensive test suite: The
example.zfile now demonstrates all working features - Pointer examples: Added working examples of pointer usage and dereferencing
- Algorithm examples: Added Fibonacci sequence calculation example
2. Code Quality Improvements
- Enhanced code comments: Added more descriptive comments throughout the codebase
- Improved variable naming: More consistent and descriptive variable names
- Better code organization: Improved structure and organization of the code
馃敡 Technical Changes
1. Codegen.py
- Added support for pointer dereferencing in MOV assignments
- Enhanced pointer handling in PRINT statements
- Improved code generation for array operations
2. Semantics.py
- Added pointer dereferencing validation in PRINT handler
- Enhanced error messages for pointer operations
- Improved type checking for pointer operations
3. Example.z
- Updated to use working syntax for all features
- Added comprehensive test coverage
- Fixed Fibonacci calculation and pointer dereferencing
馃幆 Known Limitations
- Constants: The
CONSTkeyword still causes recursion issues in the current compiler - Float/Double Types: Missing
print_doublefunction in codegen - PRINTSTR: Not implemented in codegen (using
PRINTwith string literals as workaround) - Discard Variables: The
_variable for discarding function return values has issues in semantics validation
馃搳 Performance Improvements
- Faster compilation: Optimized code generation and semantics analysis
- Reduced memory usage: More efficient handling of variables and arrays
- Better error reporting: More descriptive and helpful error messages
馃敀 Security Enhancements
- Improved input validation: Better validation of pointer operations
- Enhanced error handling: More robust handling of edge cases
- Better memory management: Improved cleanup of temporary variables
馃搵 Breaking Changes
None. This release maintains backward compatibility with existing Z language code.
馃摉 Migration Guide
No migration required.