Nix Language Quirks: Difference between revisions

Link to manual for indented strings. Also change capitalization to match manual
Tags: Mobile edit Mobile web edit
Line 121: Line 121:
</syntaxHighlight>
</syntaxHighlight>


== Indented String trims leading whitespace ==
== Indented strings trim leading whitespace ==


Not really surprising, but ...
Not really surprising, but ...


Leading spaces are removed also in single-line Indented Strings
Leading spaces are removed also in single-line <strong>indented strings</strong>.


<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
Line 131: Line 131:
</syntaxHighlight>
</syntaxHighlight>


Usually, Indented Strings have multiple lines
Usually, indented strings have multiple lines:


<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
Line 147: Line 147:
</syntaxhighlight>
</syntaxhighlight>


See [https://github.com/NixOS/nix/issues/7834 NixOS/nix#7834] and [https://github.com/NixOS/nix/pull/9971 NixOS/nix#9971] for more information.
This is documented in more detail in the [https://nix.dev/manual/nix/2.24/language/syntax#string-literal String section] of the Nix reference manual. Also see [https://github.com/NixOS/nix/issues/7834 NixOS/nix#7834] and [https://github.com/NixOS/nix/pull/9971 NixOS/nix#9971] for more information.


== Integer precision ==
== Integer precision ==