Conversation
Updated the `eldritch-core` parser to produce user-friendly error messages when encountering unexpected tokens.
- Implemented `fmt::Display` for `TokenKind` in `src/token.rs` to provide readable string representations of tokens (e.g., `+` instead of `Plus`).
- Modified `src/parser/expr.rs` to use this display format in error messages, changing "Found Token { ... }" to "unexpected token '...'".
This resolves the issue where parser errors exposed internal debug representations to the user.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
Summary
Previous Results
Insights
Fail Rate
Failed Tests
Slowest Tests
🍂 No flaky tests in this run. Github Test Reporter by CTRF 💚 🔄 This comment has been updated |
| } | ||
|
|
||
| self.error(&format!("Expect expression. Found {:?}", self.peek())) | ||
| self.error(&format!("unexpected token \"{}\"", self.peek().kind)) |
There was a problem hiding this comment.
Jules uppercase this "Unexpected..."
There was a problem hiding this comment.
Done, I have uppercased the error message.
Uppercased "Unexpected" in the parser error message as requested in code review.
|
Fixes #1296 |
Acknowledged. |
Uppercased "Unexpected" in the parser error message as requested in code review.
Improved readability of parser error messages by implementing
DisplayforTokenKindand updating the error formatting logic. Errors now report "unexpected token 'X'" instead of dumping the internal Token struct debug output. Verified with a regression test case covering the reported issue.PR created automatically by Jules for task 4951876564411198904 started by @KCarretto