libexpr: Warn on incorrect string usage

The indentation stripping semantics of strings are fairly bad and have a
few gotchas where they behave unintuitively. But the good news is, that
these cases are easy to catch and can be avoided.
This commit adds a warning in the parser when such strings are detected.

Unfortunately Nixpkgs uses this kind of a lot, so we won't be able to
actually enable this warning for a while to come.

Co-authored-by: Commentator2.0 <lix@crystal-cavern.systems>
Change-Id: I3b3b68c2eee4cd70959d3f4ca643cb6caf3a2217
This commit is contained in:
piegames
2026-01-31 15:32:27 +01:00
co-authored by Commentator2.0
parent 4e1c216fd3
commit f1fbd1d095
11 changed files with 125 additions and 3 deletions
@@ -0,0 +1,13 @@
[[test]]
runner = "eval-okay"
matrix = true
flags = ["--extra-deprecated-features", "broken-string-indentation"]
[[test]]
name = "depr-warning"
runner = "eval-okay"
in = "in.nix"
[[test]]
runner = "parse-okay"
flags = ["--extra-deprecated-features", "broken-string-indentation"]