about summary refs log tree commit diff
path: root/src/libexpr/parser.y
AgeCommit message (Collapse)AuthorFilesLines
2006-02-13 * Override YYMALLOC and YYFREE so that we can call AT[un]protectMemoryEelco Dolstra1-0/+20
on the Bison parse stack. Otherwise, a garbage collect during parsing could lead to a crash.
2005-09-14 * List concatenation must be right-associative for efficiency.Eelco Dolstra1-1/+1
2005-07-25 * Added a list concatenation operator:Eelco Dolstra1-0/+2
[1 2 3] ++ [4 5 6] => [1 2 3 4 5 6]
2004-11-03 * string2ATerm -> overloaded toATerm.Eelco Dolstra1-2/+7
2004-10-29 * Drop ATmake / ATMatcher also in handling store expressions.Eelco Dolstra1-1/+1
2004-10-26 * Don't use ATmake / ATmatch anymore, nor the ATMatcher class.Eelco Dolstra1-33/+38
Instead we generate data bindings (build and match functions) for the constructors specified in `constructors.def'. In particular this removes the conversions between AFuns and strings, and Nix expression evaluation now seems 3 to 4 times faster.
2004-10-26 * String/path concatenation operator (`+').Eelco Dolstra1-0/+2
2004-10-25 * New language feature: with expressions.Eelco Dolstra1-7/+5
The expression `with E1; E2' evaluates to E2 with all bindings in the attribute set E1 substituted. E.g., with {x = 123;}; x evaluates to 123. That is, the attribute set E1 is in scope in E2. This is particularly useful when importing files containing lots definitions. E.g., instead of let { inherit (import ./foo.nix) a b c d e f; body = ... a ... f ...; } we can now say with import ./foo.nix; ... a ... f ... I.e., we don't have to say what variables should be brought into scope.
2004-04-05 * When something goes wrong in the evaluation of a Nix expression,Eelco Dolstra1-5/+14
print a nice backtrace of the stack, rather than vomiting a gigantic (and useless) aterm on the screen. Example: error: while evaluating file `.../pkgs/system/test.nix': while evaluating attribute `subversion' at `.../pkgs/system/all-packages-generic.nix', line 533: while evaluating function at `.../pkgs/applications/version-management/subversion/default.nix', line 1: assertion failed at `.../pkgs/applications/version-management/subversion/default.nix', line 13 Since the Nix expression language is lazy, the trace may be misleading. The purpose is to provide a hint as to the location of the problem.
2004-03-28 * Added an operator `?' to test for attribute existence, e.g.,Eelco Dolstra1-0/+2
`attrs ? x' yields true iff `attrs' has an attribute named `x'.
2004-03-28 * Added an operator `~' to select paths within a derivation. E.g.,Eelco Dolstra1-0/+2
{stdenv, bash}: derivation { builder = bash ~ /bin/sh; args = ["-e" "-x" ./builder.sh]; ... } Here the attribute `builder' will evaluate to, e.g., `/nix/store/1234abcd...-bash-2.0.1/bin/sh'.
2004-03-28 * Added plain lambdas, e.g., `let { id = x: x; const = x: y: x; }'.Eelco Dolstra1-0/+2
`bla:' is now no longer parsed as a URL. * Re-enabled support for the `args' attribute in derivations to specify command line arguments to the builder, e.g., ... builder = /usr/bin/python; args = ["-c" ./builder.py]; ...
2004-02-19 * Resolve an ambiguity between ifs and attribute selection, e.g., `ifEelco Dolstra1-3/+7
b then x else y.z'.
2004-02-04 * Extended the `inherit' syntax to optionally select attributes fromEelco Dolstra1-3/+8
other attribute sets, rather than the current scope. E.g., {inherit (pkgs) gcc binutils;} is equivalent to {gcc = pkgs.gcc; binutils = pkgs.binutils;} I am not so happy about the syntax.
2004-02-04 * An attribute set update operator (//). E.g.,Eelco Dolstra1-0/+2
{x=1; y=2; z=3;} // {y=4;} => {x=1; y=4; z=3;}
2004-02-02 * Added syntactic sugar to the construction of attribute sets toEelco Dolstra1-5/+15
`inherit' variables from the surrounding lexical scope. E.g., {stdenv, libfoo}: derivation { builder = ./bla; inherit stdenv libfoo; xyzzy = 1; } is equivalent to {stdenv, libfoo}: derivation { builder = ./bla; stdenv = stdenv; libfoo = libfoo; xyzzy = 1; } Note that for mutually recursive attribute set definitions (`rec {...}'), this also works, that is, `rec {inherit x;}' is equivalent to `let {fresh = x; body = rec {x = fresh;};}', *not* `rec {x = x}'.
2004-01-30 * Parser numbers again.Eelco Dolstra1-0/+1
* Include missing files in distributions.
2004-01-30 * Replaced the SDF parser by a substantially faster Bison/FlexEelco Dolstra1-0/+128
parser (roughly 80x faster). The absolutely latest version of Bison (1.875c) is required for reentrant GLR support, as well as a recent version of Flex (say, 2.5.31). Note that most Unix distributions ship with the prehistoric Flex 2.5.4, which doesn't support reentrancy.