diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-02-04T16·03+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-02-04T16·03+0000 |
commit | 9b44480612dd30a7292ec94a88e4018b8f18e3f0 (patch) | |
tree | 0c83114806a4f7724a5dd8dcb0694103e70acb71 /src/nix-instantiate/main.cc | |
parent | c4f7ae4aa5fc7071cfa853ec5d75aaf00e7a97fc (diff) |
* Use a map to lookup primops.
* Various performance improvements in the evaluator. * Do not link against unused (and missing!) libraries (-lsglr, etc.).
Diffstat (limited to 'src/nix-instantiate/main.cc')
-rw-r--r-- | src/nix-instantiate/main.cc | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/src/nix-instantiate/main.cc b/src/nix-instantiate/main.cc index 305c3b551ca5..cc3444837cd5 100644 --- a/src/nix-instantiate/main.cc +++ b/src/nix-instantiate/main.cc @@ -15,31 +15,12 @@ void printHelp() } -#if 0 -static Path searchPath(const Paths & searchDirs, const Path & relPath) -{ - if (string(relPath, 0, 1) == "/") return relPath; - - for (Paths::const_iterator i = searchDirs.begin(); - i != searchDirs.end(); i++) - { - Path path = *i + "/" + relPath; - if (pathExists(path)) return path; - } - - throw Error( - format("path `%1%' not found in any of the search directories") - % relPath); -} -#endif - - static Expr evalStdin(EvalState & state) { startNest(nest, lvlTalkative, format("evaluating standard input")); string s, s2; while (getline(cin, s2)) s += s2 + "\n"; - Expr e = parseExprFromString(s, absPath(".")); + Expr e = parseExprFromString(state, s, absPath(".")); return evalExpr(state, e); } @@ -76,24 +57,11 @@ void run(Strings args) Strings files; bool readStdin = false; -#if 0 - state.searchDirs.push_back("."); - state.searchDirs.push_back(nixDataDir + "/nix"); -#endif - for (Strings::iterator it = args.begin(); it != args.end(); ) { string arg = *it++; -#if 0 - if (arg == "--includedir" || arg == "-I") { - if (it == args.end()) - throw UsageError(format("argument required in `%1%'") % arg); - state.searchDirs.push_back(*it++); - } - else -#endif if (arg == "-") readStdin = true; else if (arg[0] == '-') |