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

Alan-Jowett / bdd_test / 19213467604

09 Nov 2025 07:38PM UTC coverage: 88.644% (-0.2%) from 88.802%
19213467604

push

github

web-flow
refactor: Extract expression parsing logic into separate module (#18)

* refactor: Extract expression parsing logic into separate module

- Move parsing functions from main.cpp to expression_parser.cpp/.hpp
- Create clean public interface with only read_expression_from_file()
- Add comprehensive Doxygen documentation for the parser interface
- Add proper SPDX license headers to new files
- Update CMakeLists.txt to include new parser source files
- Maintain full backward compatibility and functionality

This refactoring improves code organization by separating parsing
logic from BDD conversion and visualization logic, making the
codebase more maintainable and modular.

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* fix: Address all code review comments for expression parser

Critical fixes:
- Add missing #pragma once include guard to expression_parser.hpp
- Fix potential crash from accessing empty string in parse_expression()
- Fix type mismatch (size_t vs int) in operator search loop
- Add proper bounds checking for parentheses validation

Documentation fixes:
- Correct operator precedence documentation (NOT > AND > OR > XOR)
- Fix return type documentation (unique_ptr vs shared_ptr)
- Remove unimplemented C-style identifier validation claim

Logic improvements:
- Fix NOT operator length check from > 3 to >= 3
- Add comprehensive empty expression handling
- Improve safety with size checks before string access

All 24 tests pass. Addresses GitHub PR #18 review comments from
Copilot and CodeRabbit automated reviews.

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

---------

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>

648 of 764 branches covered (84.82%)

Branch coverage included in aggregate %.

76 of 77 new or added lines in 1 file covered. (98.7%)

601 of 645 relevant lines covered (93.18%)

221.92 hits per line

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

91.81
/expression_parser.cpp


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