Skip to content

Fix eldritch-core and repl compilation errors#1430

Merged
KCarretto merged 1 commit intoeldritch-lexer-refactor-11738474779397551328from
fix-eldritch-lexer-errors-1792843230915524575
Dec 27, 2025
Merged

Fix eldritch-core and repl compilation errors#1430
KCarretto merged 1 commit intoeldritch-lexer-refactor-11738474779397551328from
fix-eldritch-lexer-errors-1792843230915524575

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

Fixed compilation errors in eldritch-core and eldritch-repl caused by the recent update to the lexer which made it infallible (returning Vec<Token> instead of Result). Implemented error handling for the new TokenKind::Error variant and updated REPL logic to scan the token stream for errors. verified that tests pass.


PR created automatically by Jules for task 1792843230915524575 started by @KCarretto

- Updated `eldritch-core/src/token.rs` to handle `TokenKind::Error` in `fmt::Display`.
- Updated `eldritch-repl/src/core.rs` to handle `Vec<Token>` return type from `Lexer::scan_tokens` and correctly process error tokens for REPL logic.
- Verified that all tests pass in `implants/`.
@google-labs-jules
Copy link
Copy Markdown
Contributor Author

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@KCarretto KCarretto marked this pull request as ready for review December 27, 2025 20:03
@KCarretto KCarretto merged commit 702d65e into eldritch-lexer-refactor-11738474779397551328 Dec 27, 2025
@KCarretto KCarretto deleted the fix-eldritch-lexer-errors-1792843230915524575 branch December 27, 2025 20:03
KCarretto added a commit that referenced this pull request Dec 28, 2025
* Refactor Lexer to be infallible for better LSP support

- Changed `Lexer::scan_tokens` to return `Vec<Token>` instead of `Result`.
- Added `TokenKind::Error` to represent syntax errors (e.g., unterminated strings, invalid chars) without aborting the token stream.
- Updated `Interpreter::interpret` to check for `TokenKind::Error` and return early errors, preserving runtime behavior.
- Updated `Interpreter::complete` to ignore error tokens, allowing autocompletion to work on partially invalid code.
- Updated tests to match the new infallible Lexer API.

* cargo fmt

* Fix compilation errors due to infallible lexer update (#1430)

- Updated `eldritch-core/src/token.rs` to handle `TokenKind::Error` in `fmt::Display`.
- Updated `eldritch-repl/src/core.rs` to handle `Vec<Token>` return type from `Lexer::scan_tokens` and correctly process error tokens for REPL logic.
- Verified that all tests pass in `implants/`.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>

* cargo fmt

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <Kcarretto@gmail.com>
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.

1 participant