Our old parser allowed block comment stacking, but it also allowed the user to not close the block comments properly:
/* /* */ foo = 1
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:
/* top /* nested */ top */ foo = 1
This is breaking change, but it's pretty easy to fix. Also our editor parsers (IntelliJ, tree-sitter, textMate) don't allow stacking.
🔄 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/1022
**Author:** [@stackoverflow](https://github.com/stackoverflow)
**Created:** 3/12/2025
**Status:** ✅ Merged
**Merged:** 3/12/2025
**Merged by:** [@stackoverflow](https://github.com/stackoverflow)
**Base:** `main` ← **Head:** `fix-comment-stacking`
---
### 📝 Commits (1)
- [`5a22d73`](https://github.com/apple/pkl/commit/5a22d7339e45047dac443eabb37b244fa40ea373) remove stacking of block comments
### 📊 Changes
**2 files changed** (+6 additions, -7 deletions)
<details>
<summary>View changed files</summary>
📝 `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)
</details>
### 📄 Description
Our old parser allowed block comment stacking, but it also allowed the user to not close the block comments properly:
```pkl
/* /* */ foo = 1
```
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:
```pkl
/* top /* nested */ top */ foo = 1
```
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
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 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.