Running pkl eval -f json file.pkl produces the following error:
No viable alternative at input `-hyphen =`.
Expected behavior
I would expect pkl eval -f json file.pkl to produce the following:
{
"test": {
"with-hyphen": "test"
}
}
Thank you.
Originally created by @tmanternach on GitHub (Mar 18, 2024).
**What are you trying to achieve?**
I am trying to use pkl to produce a json file that uses hypens in many property names.
**What’s the impact of this bug/feature?**
I cannot use pkl to produce this json file.
`pkl --version` Pkl 0.25.2 (Linux 5.15.0-1050-aws, native)
### Test file
```
test {
with-hyphen = "test"
}
```
Running `pkl eval -f json file.pkl` produces the following error:
```–– Pkl Error ––
No viable alternative at input `-hyphen =`.
```
### Expected behavior
I would expect `pkl eval -f json file.pkl` to produce the following:
```
{
"test": {
"with-hyphen": "test"
}
}
```
Thank you.
@StefMa commented on GitHub (Mar 18, 2024):
Same applies BTW for keywords.
E.g
```
`function` = 2
```
On Mon, Mar 18, 2024, 6:25 PM Trevor Manternach ***@***.***>
wrote:
> Thank you! I swear I tried everything *but* backticks.
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/apple/pkl/issues/334#issuecomment-2004519697>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ACOBQ67JE3VXJF266WS3RNTYY4PRHAVCNFSM6AAAAABE4AKBB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUGUYTSNRZG4>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
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.
Originally created by @tmanternach on GitHub (Mar 18, 2024).
What are you trying to achieve?
I am trying to use pkl to produce a json file that uses hypens in many property names.
What’s the impact of this bug/feature?
I cannot use pkl to produce this json file.
pkl --versionPkl 0.25.2 (Linux 5.15.0-1050-aws, native)Test file
Running
pkl eval -f json file.pklproduces the following error:Expected behavior
I would expect
pkl eval -f json file.pklto produce the following:Thank you.
@odenix commented on GitHub (Mar 18, 2024):
You can use backticks:
@tmanternach commented on GitHub (Mar 18, 2024):
Thank you! I swear I tried everything but backticks.
@StefMa commented on GitHub (Mar 18, 2024):
Same applies BTW for keywords.
E.g
On Mon, Mar 18, 2024, 6:25 PM Trevor Manternach @.***>
wrote: