Commit graph

10 commits

Author SHA1 Message Date
semihalev
171e6d313e Clear some indent problems 2025-03-11 14:24:33 +03:00
semihalev
61a826f54c Optimize filter chain handling
- Improved HTML escape filter using strings.Builder for single-pass escaping
- Optimized filter chain building to avoid O(n²) prepending operations
- Added benchmarks for filter chain operations with different depths
- Enhanced escape filter performance with pre-allocation strategy
- Filter chain collection now has O(n) complexity instead of O(n²)

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-11 14:23:29 +03:00
semihalev
16c954898f Fix macro functionality and add comprehensive tests
- Fixed macro parameter parsing with improved tokenization handling
- Added support for proper module.function() syntax in templates
- Enhanced filter handling within macro variables
- Added support for variable interpolation in macro body
- Added comprehensive test suite for macros with various scenarios
- Improved overall coverage from 43.8% to 45.7%

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-11 13:15:07 +03:00
semihalev
02a61819c0 Clear some indent problems 2025-03-11 11:42:59 +03:00
semihalev
a38fa8631a Fix array filters and add support for GetItemNode and array access
This commit fixes the TestArrayFilters tests by implementing proper support for array access and map literals in the template engine. Key improvements include:

1. Added support for GetItemNode to handle array access with square brackets
2. Implemented parseMapExpression to handle map/object literals with curly braces
3. Fixed string ordering in the Keys filter by adding proper sorting
4. Added support for array access in variable attributes
5. Improved the expression parsing to handle chained operators properly

These changes allow complex expressions like {{ people[0].name }} to work correctly
and ensure that array filters like sort, keys, and merge function properly.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-11 11:37:31 +03:00
semihalev
cce67f94c9 Fix code style inconsistencies and update documentation
- Update documentation with negative step range workaround
- Document limitations and solutions in FINDINGS.md and SOLUTION.md
- Clean up code style and remove experimental files
- Optimize performance in core functions
- Fix whitespace and end-of-file newlines

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-11 09:29:12 +03:00
semihalev
98857eb47c Fix string rendering in scripts and JSON-style object handling in includes
- Enhance parseInclude to support JSON-style object literals with braces
- Add special handling for JavaScript values to ensure proper quoting
- Preserve CSS formatting for units, colors, and font-family values
- Fix type detection to avoid quoting numbers and booleans in scripts

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-10 13:09:56 +03:00
semihalev
f9b283c393 Add template compilation capabilities
- Implement a compiled template format using gob encoding
- Add methods to compile templates and load from compiled templates
- Create dedicated CompiledLoader for managing compiled templates
- Enable auto-reload support for compiled templates
- Add comprehensive tests including benchmarks
- Create example application for template compilation workflow
- Update documentation with compilation features and examples

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-10 09:21:20 +03:00
semihalev
c4faeb33d6 Add template auto-reload and optimize filter chain processing
- Implement template modification time tracking for auto-reload
- Add TimestampAwareLoader interface and implementation
- Improve caching with proper reload when files change
- Optimize filter chain processing for better performance
- Add benchmarks for filter chain optimization
- Update documentation with new features

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-10 08:34:47 +03:00
semihalev
640a8d1c4a Add filter support and custom extension API
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-10 08:16:49 +03:00