mirror of
https://github.com/apple/pkl.git
synced 2026-01-11 22:30:54 +01:00
[PR #1022] [MERGED] Remove stacking of block comments #856
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/1022
Author: @stackoverflow
Created: 3/12/2025
Status: ✅ Merged
Merged: 3/12/2025
Merged by: @stackoverflow
Base:
main← Head:fix-comment-stacking📝 Commits (1)
5a22d73remove stacking of block comments📊 Changes
2 files changed (+6 additions, -7 deletions)
View changed files
📝
pkl-core/src/main/java/org/pkl/core/parser/Lexer.java(+5 -5)📝
pkl-core/src/test/files/LanguageSnippetTests/input/basic/comments.pkl(+1 -2)📄 Description
Our old parser allowed block comment stacking, but it also allowed the user to not close the block comments properly:
This can lead to a massive backtracking in the lexer, so we decided to remove this feature. Block comments don't stack anymore, so this previously valid Pkl code is not valid anymore:
This is breaking change, but it's pretty easy to fix. Also our editor parsers (IntelliJ, tree-sitter, textMate) don't allow stacking.
Fixes #1014
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.