Skip to content

Formatting unquotes interpolation #197

@mmarx

Description

@mmarx

Consider foo.nix:

''
  O=''\'''${A}'
''

Formatting changes the semantics of this, turning it into an interpolation:

''
  O='''${A}'
''
foo.nix: Parses differently after formatting. This is a bug in nixfmt. Please report it at https://github.com/NixOS/nixfmt

Before formatting:
Term (IndentedString (Ann [] [[TextPart "O='''${A}'"],[]] Nothing))

After formatting:
Term (IndentedString (Ann [] [[TextPart "O='''",Interpolation Term (Token (Ann [] (Identifier "A") Nothing)),TextPart "'"],[]] Nothing))

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcorrectnessOutput parses differently after formatting

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions