Parser accepts wrong string escapes #263

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

Originally created by @stackoverflow on GitHub (Jan 17, 2025).

foo = "foo \#(1)"

The above code renders foo as foo 1 even though this is not syntactically valid Pkl.
In fact any number of # can be used and Pkl will still parse the interpolation.

The correct code would be:

foo = #"foo \#(1)"#
Originally created by @stackoverflow on GitHub (Jan 17, 2025). ```pkl foo = "foo \#(1)" ``` The above code renders foo as `foo 1` even though this is not syntactically valid Pkl. In fact any number of `#` can be used and Pkl will still parse the interpolation. The correct code would be: ```pkl foo = #"foo \#(1)"# ```
adam closed this issue 2025-12-30 01:22:57 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#263