Doc comments with interleaving comments result in an error #275

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

Originally created by @stackoverflow on GitHub (Feb 4, 2025).

Adding a line or block comment between a doc comment results in an error, even though it should be ignored.

Example:

/// doc comment
// line comment
/// doc continuation
foo = 1

Fails with:

–– Pkl Error ––
No viable alternative at input `/// doc comment\n// line comment\n/// doc continuation\n`.

3 | /// doc continuation
    ^^^^^^^^^^^^^^^^^^^^^
at foo (.../foo.pkl:3)

Originally created by @stackoverflow on GitHub (Feb 4, 2025). Adding a line or block comment between a doc comment results in an error, even though it should be ignored. Example: ```pkl /// doc comment // line comment /// doc continuation foo = 1 ``` Fails with: ```bash –– Pkl Error –– No viable alternative at input `/// doc comment\n// line comment\n/// doc continuation\n`. 3 | /// doc continuation ^^^^^^^^^^^^^^^^^^^^^ at foo (.../foo.pkl:3) ```
adam closed this issue 2025-12-30 01:23:07 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#275