Skip to content

New debugging span (using range). #1123#1148

Merged
tomtau merged 2 commits intopest-parser:masterfrom
re-masashi:master
Jan 15, 2026
Merged

New debugging span (using range). #1123#1148
tomtau merged 2 commits intopest-parser:masterfrom
re-masashi:master

Conversation

@re-masashi
Copy link
Contributor

@re-masashi re-masashi commented Jan 13, 2026

Changed debug span from having separate start and end fields to using range.

One test fails but it kept failing even before I made my changes.
Same for some clippy warnings.

Summary by CodeRabbit

  • Style
    • Updated debug output formatting for internal position information: start/end are now shown as a single contiguous range (applies throughout nested debug displays).

✏️ Tip: You can customize this high-level summary in your review settings.

@re-masashi re-masashi requested a review from a team as a code owner January 13, 2026 01:27
@re-masashi re-masashi requested review from tomtau and removed request for a team January 13, 2026 01:27
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 13, 2026

📝 Walkthrough

Walkthrough

Span's Debug output was changed to show a single range: start..end field instead of separate start and end fields; tests expecting debug strings in pest/src/iterators/pairs.rs were updated to match. No behavioral changes to Span or parsing logic.

Changes

Cohort / File(s) Summary
Span Debug Implementation
pest/src/span.rs
Debug formatting now emits a single range: X..Y field (uses a local start..end range) rather than separate start and end fields. Signature/generic lifetime adjusted in the Debug impl.
Debug Output Test Expectations
pest/src/iterators/pairs.rs
Test expected debug strings updated to reflect the consolidated range: X..Y representation for inner and nested spans.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

🐰 I nibbled bytes and found the range,
From start to end it's now arranged,
One hop, one field, neat and bright,
Debug prints snug through day and night. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'New debugging span (using range). #1123' clearly and directly describes the main change: modifying the debug representation of Span from separate start/end fields to a single range field.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 562c2c9 and 2692a15.

📒 Files selected for processing (1)
  • pest/src/span.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • pest/src/span.rs

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the issue with the original debug print format?

@re-masashi
Copy link
Contributor Author

What's the issue with the original debug print format?

idrk, just preference ig?
the issue was open so I just made the necessary changes.

(it's also a bit nicer to work with imo.)

@tomtau
Copy link
Contributor

tomtau commented Jan 14, 2026

oh, it's this issue: #1123 sorry.

@tomtau tomtau linked an issue Jan 14, 2026 that may be closed by this pull request
pest/src/span.rs Outdated
}

impl fmt::Debug for Span<'_> {
impl<'i> fmt::Debug for Span<'i> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the explicit lifetime needed? The clippy issue shows the original code before the change was ok / it can be elided: https://github.com/pest-parser/pest/actions/runs/20941202000/job/60191732029?pr=1148#step:5:229

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can change it to be that way. clippy was just yelling at me, that's all.
clippy 0.1.91 (9c27f27ea3 2025-09-08)

@tomtau tomtau merged commit a70abdb into pest-parser:master Jan 15, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use range in debugging span

2 participants