[PR #1187] [MERGED] Correctly handle EOF after unmatched backtick #931

Closed
opened 2025-12-30 01:27:49 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/1187
Author: @HT154
Created: 8/25/2025
Status: Merged
Merged: 8/25/2025
Merged by: @HT154

Base: mainHead: repl-unmatched-backtick


📝 Commits (1)

  • d4cdc5b Correctly handle EOF after unmatched backtick

📊 Changes

5 files changed (+31 additions, -2 deletions)

View changed files

📝 pkl-cli/src/test/kotlin/org/pkl/cli/repl/ReplMessagesTest.kt (+8 -1)
pkl-core/src/test/files/LanguageSnippetTests/input/errors/singleBacktick.pkl (+1 -0)
pkl-core/src/test/files/LanguageSnippetTests/output/errors/singleBacktick.err (+7 -0)
📝 pkl-parser/src/main/java/org/pkl/parser/Lexer.java (+8 -1)
📝 pkl-parser/src/test/kotlin/org/pkl/parser/LexerTest.kt (+7 -0)

📄 Description

Resolves #1182

This issue does actually affect both pkl repl and pkl eval. It's trickier to observe for eval because many editors add a trailing newline automatically, which avoids the bug. Here's a repro for eval:

$ echo -n '`' | pkl eval /dev/stdin
An unexpected error has occurred. Would you mind filing a bug report?

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/apple/pkl/pull/1187 **Author:** [@HT154](https://github.com/HT154) **Created:** 8/25/2025 **Status:** ✅ Merged **Merged:** 8/25/2025 **Merged by:** [@HT154](https://github.com/HT154) **Base:** `main` ← **Head:** `repl-unmatched-backtick` --- ### 📝 Commits (1) - [`d4cdc5b`](https://github.com/apple/pkl/commit/d4cdc5ba3ce53e7f2b53fe3a741b60738921f79b) Correctly handle EOF after unmatched backtick ### 📊 Changes **5 files changed** (+31 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `pkl-cli/src/test/kotlin/org/pkl/cli/repl/ReplMessagesTest.kt` (+8 -1) ➕ `pkl-core/src/test/files/LanguageSnippetTests/input/errors/singleBacktick.pkl` (+1 -0) ➕ `pkl-core/src/test/files/LanguageSnippetTests/output/errors/singleBacktick.err` (+7 -0) 📝 `pkl-parser/src/main/java/org/pkl/parser/Lexer.java` (+8 -1) 📝 `pkl-parser/src/test/kotlin/org/pkl/parser/LexerTest.kt` (+7 -0) </details> ### 📄 Description Resolves #1182 This issue does actually affect both `pkl repl` and `pkl eval`. It's trickier to observe for eval because many editors add a trailing newline automatically, which avoids the bug. Here's a repro for eval: ```console $ echo -n '`' | pkl eval /dev/stdin An unexpected error has occurred. Would you mind filing a bug report? ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:27:49 +01:00
adam closed this issue 2025-12-30 01:27:49 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#931