From 2698fe8611d5fbc5db1d321473f83f446664c83c Mon Sep 17 00:00:00 2001 From: toonn Date: Mon, 11 May 2026 13:13:24 +0200 Subject: [PATCH] manual: Update Attribute Set section to exclude indented strings and URIs Indented strings and URIs are string literals but they are not allowed as names for attrsets, `let` or `inherit`. The following snippets illustrate that they lead to syntax errors. ==> examples/ind_str-attr.nix <== { ''indented string'' = "error: syntax error, expecting '}'"; } ==> examples/ind_str-inherit.nix <== { inherit ({ "non-indented string" = "error: syntax error, expecting ';'"; }) ''non-indented string''; } ==> examples/ind_str-let.nix <== let ''indented string'' = "error: syntax error, expecting 'in'"; in true ==> examples/uri-attr.nix <== { http://example.org/foo.tar.bz2 = "error: syntax error, expecting '}'"; } ==> examples/uri-inherit.nix <== { inherit ({ "http://example.org/foo.tar.bz2" = "error: syntax error, expecting ';'"; }) http://example.org/foo.tar.bz2; } ==> examples/uri-let.nix <== let http://example.org/foo.tar.bz2 = "error: syntax error, expecting 'in'"; in true Change-Id: I6774af93baf9f533877642a563775667c518ea88 --- doc/manual/src/language/values.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manual/src/language/values.md b/doc/manual/src/language/values.md index ae4e9bd14..a9edf9946 100644 --- a/doc/manual/src/language/values.md +++ b/doc/manual/src/language/values.md @@ -164,7 +164,7 @@ Note that lists are only lazy in values, and they are strict in length. An attribute set is a collection of name-value-pairs (called *attributes*) enclosed in curly brackets (`{ }`). -An attribute name can be an identifier or a [string](#type-string). +An attribute name can be an identifier or a [double-quoted string](#type-string). An identifier must start with a letter (`a-z`, `A-Z`) or underscore (`_`), and can otherwise contain letters (`a-z`, `A-Z`), numbers (`0-9`), underscores (`_`), apostrophes (`'`), or dashes (`-`). > *name* = *identifier* | *string* \