about summary refs log tree commit diff
path: root/src/libexpr/nixexpr-ast.def
AgeCommit message (Collapse)AuthorFilesLines
2007-11-30 * Added a new kind of multi-line string literal delimited by twoEelco Dolstra1-0/+3
single quotes. Example (from NixOS): job = '' start on network-interfaces start script rm -f /var/run/opengl-driver ${if videoDriver == "nvidia" then "ln -sf ${nvidiaDrivers} /var/run/opengl-driver" else if cfg.driSupport then "ln -sf ${mesa} /var/run/opengl-driver" else "" } rm -f /var/log/slim.log end script ''; This style has two big advantages: - \, ' and " aren't special, only '' and ${. So you get a lot less escaping in shell scripts / configuration files in Nixpkgs/NixOS. The delimiter '' is rare in scripts (and can usually be written as ""). ${ is also fairly rare. Other delimiters such as <<...>>, {{...}} and <|...|> were also considered but this one appears to have the fewest drawbacks (thanks Martin). - Indentation is intelligently stripped so that multi-line strings can follow the nesting structure of the containing Nix expression. E.g. in the example above 6 spaces are stripped from the start of each line. This prevents unnecessary indentation in generated files (which sometimes even breaks things). See tests/lang/eval-okay-ind-string.nix for some examples.
2006-10-17 * Backwards compatibility with old user environment manifests.Eelco Dolstra1-1/+2
2006-10-16 * Big cleanup of the semantics of paths, strings, contexts, stringEelco Dolstra1-2/+30
concatenation and string coercion. This was a big mess (see e.g. NIX-67). Contexts are now folded into strings, so that they don't cause evaluation errors when they're not expected. The semantics of paths has been clarified (see nixexpr-ast.def). toString() and coerceToString() have been merged. Semantic change: paths are now copied to the store when they're in a concatenation (and in most other situations - that's the formalisation of the meaning of a path). So "foo " + ./bla evaluates to "foo /nix/store/hash...-bla", not "foo /path/to/current-dir/bla". This prevents accidental impurities, and is more consistent with the treatment of derivation outputs, e.g., `"foo " + bla' where `bla' is a derivation. (Here `bla' would be replaced by the output path of `bla'.)
2006-10-11 * Removed URIs from the evaluator (NIX-66). They are now just anotherEelco Dolstra1-1/+0
kind of notation for strings.
2006-07-24 * Refactoring to support domain checks.Eelco Dolstra1-2/+7
2006-05-02 * Use a linked list of substitutions. This reduces the amount ofEelco Dolstra1-0/+1
copying.
2006-05-01 * String interpolation. Expressions likeEelco Dolstra1-0/+1
"--with-freetype2-library=" + freetype + "/lib" can now be written as "--with-freetype2-library=${freetype}/lib" An arbitrary expression can be enclosed within ${...}, not just identifiers. * Escaping in string literals: \n, \r, \t interpreted as in C, any other character following \ is interpreted as-is. * Newlines are now allowed in string literals.
2006-05-01 * Allow string concatenations involving derivations, e.g.,Eelco Dolstra1-0/+1
configureFlags = "--with-freetype2-library=" + freetype + "/lib";
2005-07-25 * Added a list concatenation operator:Eelco Dolstra1-0/+1
[1 2 3] ++ [4 5 6] => [1 2 3 4 5 6]
2004-10-29 * Drop ATmake / ATMatcher also in handling store expressions.Eelco Dolstra1-0/+55