diff options
Diffstat (limited to 'src/libexpr')
-rw-r--r-- | src/libexpr/eval.hh | 2 | ||||
-rw-r--r-- | src/libexpr/parser.y | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index 1e32db1e86bd..04a36b14cefa 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -118,6 +118,8 @@ public: Expr * parseExprFromString(const string & s, const Path & basePath, StaticEnv & staticEnv); Expr * parseExprFromString(const string & s, const Path & basePath); + Expr * parseStdin(); + /* Evaluate an expression read from the given file to normal form. */ void evalFile(const Path & path, Value & v); diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index 62982650a22e..ca3d057451ab 100644 --- a/src/libexpr/parser.y +++ b/src/libexpr/parser.y @@ -601,6 +601,13 @@ Expr * EvalState::parseExprFromString(const string & s, const Path & basePath) } +Expr * EvalState::parseStdin() +{ + //Activity act(*logger, lvlTalkative, format("parsing standard input")); + return parseExprFromString(drainFD(0), absPath(".")); +} + + void EvalState::addToSearchPath(const string & s) { size_t pos = s.find('='); |