Fix span ordering checks#49
Fix span ordering checks#49leynos merged 1 commit intocodex/refactor-build_green_tree-parametersfrom
Conversation
Reviewer's GuideThis PR refactors the span-ordering assertion in ParsedSpans::assert_sorted to use a centralized ensure_span_lists_sorted helper instead of manual iteration, removes the obsolete iterator method, and updates tests to invoke the new build_green_tree API by passing a ParsedSpans instance. Class diagram for ParsedSpans and related changesclassDiagram
class ParsedSpans {
+Vec<Range> imports
+Vec<Range> typedefs
+Vec<Range> relations
+Vec<Range> indexes
+Vec<Range> functions
+Vec<Range> rules
+assert_sorted()
}
class ensure_span_lists_sorted {
<<function>>
}
ParsedSpans --|> ensure_span_lists_sorted : uses
Class diagram for build_green_tree API updateclassDiagram
class build_green_tree {
<<function>>
+build_green_tree(tokens, src, spans: &ParsedSpans)
}
class ParsedSpans {
+Vec<Range> imports
+Vec<Range> typedefs
+Vec<Range> relations
+Vec<Range> indexes
+Vec<Range> functions
+Vec<Range> rules
}
build_green_tree --|> ParsedSpans : takes as argument
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate Unit Tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
2d1f73d
into
codex/refactor-build_green_tree-parameters
* Refactor parser span handling * Add utilities for ParsedSpans * Derive PartialEq for ParsedSpans * Fix span ordering checks (#49)
Summary
ParsedSpans::assert_sortedto aggregate checksTesting
make fmtmake lintmake testhttps://chatgpt.com/codex/tasks/task_e_68685466f4c083229c103a3dbf5f45f3
Summary by Sourcery
Fix and centralize span ordering validation and adapt the builder API and tests to use the new ParsedSpans struct
Bug Fixes:
Enhancements:
Tests: