• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

carthage-software / cel-php / 17638949479

11 Sep 2025 08:36AM UTC coverage: 85.152% (+19.7%) from 65.409%
17638949479

push

github

azjezz
feat: Implement AST, parser, and optimizer infrastructure

This commit introduces a complete recursive descent parser and a comprehensive Abstract Syntax Tree (AST) for the CEL language. The new components provide the foundation for evaluating CEL expressions.

Key additions include:

- A buffered TokenStream with lookahead capabilities to feed tokens to the parser.
- A full set of AST nodes under the Cel\Syntax namespace to represent every construct in the CEL grammar. The AST is designed to be lossless, preserving all source information via Span objects.
- A new, extensible optimization framework built around an OptimizationInterface. This allows for modular, priority-based optimization passes.
- Two initial optimization passes as a proof-of-concept: UnwrapParenthesesOptimization and ShortCircuitBooleanOptimization. The main engine to run these passes is deferred.

A comprehensive test suite has been added for all new components, covering the parser, token stream, every AST node, and the new optimization passes.

All code, type, and mutation (MSI) test coverage remains at 100%.

Signed-off-by: azjezz <azjezz@protonmail.com>

463 of 475 new or added lines in 33 files covered. (97.47%)

671 of 788 relevant lines covered (85.15%)

11.45 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.24
/src/Optimizer/Optimization/ShortCircuitBooleanOptimization.php


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc