Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dhall-to-yaml incorrectly renders string values when value ends in a colon #2192

Open
timspeetjens opened this issue May 20, 2021 · 2 comments

Comments

@timspeetjens
Copy link

Using the following dhall, dhall-to-yaml does not render correctly:

{ a = [ "v:" ], b = "c:" }
$ dhall-to-yaml < t.dhall
a:
  - v:
b: c:

Both dhall-to-yaml-ng and dhall-to-json render it as expected:

$ dhall-to-yaml-ng < t.dhall 
a:
- "v:"
b: "c:"

$ dhall-to-json < t.dhall 
{
  "a": [
    "v:"
  ],
  "b": "c:"
}

Tested with dhall-to-yaml/dhall-to-json versions 1.7.4 and 1.7.6, and dhall-to-yaml-ng versions 1.2.4 and 1.2.6.

@timspeetjens
Copy link
Author

While it escaped to me, at first, output from dhall-to-yaml and dhall-to-yaml-ng are both correct, but not identical:

In the given example, indentation for arrays differ, and double quotes are added in many more places (than just string values with trailing colons):

$ dhall-to-yaml <<< '{ a-a = [ "v-v"] }'
a-a:
  - v-v

$ dhall-to-yaml-ng <<< '{ a-a = [ "v-v"] }'
"a-a":
- "v-v"

@sjakobi
Copy link
Collaborator

sjakobi commented May 27, 2021

Using the following dhall, dhall-to-yaml does not render correctly:

{ a = [ "v:" ], b = "c:" }
$ dhall-to-yaml < t.dhall
a:
  - v:
b: c:

This is due to clovyr/aeson-yaml#12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants