-
Notifications
You must be signed in to change notification settings - Fork 0
major refactoring around parsing and dsl #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
A major refactoring that centralizes CLI invocation in tests, enhances the DSL parsing capabilities (conditional templates, regex operator, improved truthiness), and restructures core parsing modules.
- Added a
parsm_command()helper across all integration tests and updated test cases to use it. - Extended the DSL parser and engine to support the
~=regex operator, conditional templates, and richer truthiness rules. - Introduced a parser registry and improved format detection heuristics in
parser_registry.rsandformat_detector.rs.
Reviewed Changes
Copilot reviewed 30 out of 34 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/* | Consolidated command invocation via parsm_command() and revised test inputs/outputs |
| src/parser_registry.rs | Added ParserRegistry for prioritized format parsing and fallback |
| src/format_detector.rs | Improved heuristics for JSON array, YAML, TOML, CSV, and logfmt detection |
| src/filter.rs | Added Regex and Conditional support, enhanced truthiness and comparison logic |
| src/dsl/template_parser.rs | Refactored template parsing to handle braced, bracketed, and numeric variables |
| src/dsl/operators.rs | Replaced ~ with ~= for regex matching, updated operator definitions |
Comments suppressed due to low confidence (1)
src/filter.rs:117
- A new
TemplateItem::Conditionalvariant was introduced but there are no unit tests covering its behavior. Add tests to verify rendering of conditionals for both truthy and falsy branches.
pub enum TemplateItem {
81a2a25 to
bde80b2
Compare
No description provided.