Skip to content

Formatting unquotes interpolation #197

Closed
@mmarx

Description

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

Assignees

Labels

bugSomething isn't workingcorrectnessOutput parses differently after formatting

Type

No type

Projects

  • Status

    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions