From 9985230c00226826949473c3862c0c3afea74aaf Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 14 Apr 2010 14:42:32 +0000 Subject: * After parsing, compute level/displacement pairs for each variable use site, allowing environments to be stores as vectors of values rather than maps. This should speed up evaluation and reduce the number of allocations. --- src/libexpr/eval-test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libexpr/eval-test.cc') diff --git a/src/libexpr/eval-test.cc b/src/libexpr/eval-test.cc index d03d3bdeed1b..bcd3670dfedc 100644 --- a/src/libexpr/eval-test.cc +++ b/src/libexpr/eval-test.cc @@ -51,11 +51,12 @@ void run(Strings args) printMsg(lvlError, format("size of value: %1% bytes") % sizeof(Value)); printMsg(lvlError, format("size of int AST node: %1% bytes") % sizeof(ExprInt)); printMsg(lvlError, format("size of attrset AST node: %1% bytes") % sizeof(ExprAttrs)); - + doTest(state, "123"); doTest(state, "{ x = 1; y = 2; }"); doTest(state, "{ x = 1; y = 2; }.y"); - doTest(state, "rec { x = 1; y = x; }.y"); + doTest(state, "let x = 1; y = 2; z = 3; in let a = 4; in y"); + doTest(state, "rec { x = 1; y = x; }.x"); doTest(state, "(x: x) 1"); doTest(state, "(x: y: y) 1 2"); doTest(state, "x: x"); -- cgit 1.4.1