Skip to content

Commit

Permalink
dhall-to-nix: Quote field selection symbols
Browse files Browse the repository at this point in the history
Another one I missed, when you have a field selector, you want to
quote it, in case it has some symbols nix does not know how to handle.

`x.Foo/bar`  will now be `x."Foo/bar"`, which is valid nix.
  • Loading branch information
Profpatsch committed Jun 20, 2022
1 parent 2f24a71 commit 1313716
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dhall-nix/src/Dhall/Nix.hs
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ dhallToNix e =
_ -> return (unionChoice k Nothing)
loop (Field a (Dhall.Core.fieldSelectionLabel -> b)) = do
a' <- loop a
return (a' @. b)
return (Fix (Nix.NSelect a' (mkDoubleQuoted b :| []) Nothing))
loop (Project a (Left b)) = do
a' <- loop a
let b' = fmap StaticKey (toList b)
Expand Down

0 comments on commit 1313716

Please sign in to comment.