1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 23:11:16 +02:00

Make "${./path} ..." evaluate to a string, not a path

Wacky string coercion semantics caused expressions like

  exec = "${./my-script} params...";

to evaluate to a path (‘/path/my-script params’), because
anti-quotations are desuged to string concatenation:

  exec = ./my-script + " params...";

By constrast, adding a space at the start would yield a string as
expected:

  exec = " ${./my-script} params...";

Now the first example also evaluates to a string.
This commit is contained in:
Eelco Dolstra 2013-02-08 19:49:24 +01:00
parent 52172607cf
commit 5f18cd2e84
3 changed files with 7 additions and 5 deletions

View file

@ -277,8 +277,10 @@ MakeBinOp(OpConcatLists, "++")
struct ExprConcatStrings : Expr
{
bool forceString;
vector<Expr *> * es;
ExprConcatStrings(vector<Expr *> * es) : es(es) { };
ExprConcatStrings(bool forceString, vector<Expr *> * es)
: forceString(forceString), es(es) { };
COMMON_METHODS
};