about summary refs log tree commit diff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-05-11T09·39+0200
committerEelco Dolstra <edolstra@gmail.com>2018-05-11T09·40+0200
commitf3c85f9eb395b13790d1fced05665125e2ec81ca (patch)
treed940404b4d215c9b2a6a7fccadcb7f3e6974e418 /src/libexpr
parent2b3c1b3a889cf8f2c210b71b208b9e14fc8fb6a6 (diff)
Revert "Throw a specific error for incomplete parse errors."
This reverts commit 6498adb002bcf7e715afe46c23b8635d4592c156. We don't
actually use IncompleteParseError in 'nix repl'.
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/lexer.l2
-rw-r--r--src/libexpr/nixexpr.hh1
-rw-r--r--src/libexpr/parser.y9
3 files changed, 1 insertions, 11 deletions
diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l
index 1e9c29afa133..8855d794ea98 100644
--- a/src/libexpr/lexer.l
+++ b/src/libexpr/lexer.l
@@ -213,7 +213,5 @@ or          { return OR_KW; }
 
 }
 
-<<EOF>> { data->atEnd = true; return 0; }
-
 %%
 
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh
index b486595f07ab..665a42987dc1 100644
--- a/src/libexpr/nixexpr.hh
+++ b/src/libexpr/nixexpr.hh
@@ -11,7 +11,6 @@ namespace nix {
 
 MakeError(EvalError, Error)
 MakeError(ParseError, Error)
-MakeError(IncompleteParseError, ParseError)
 MakeError(AssertionError, EvalError)
 MakeError(ThrownError, AssertionError)
 MakeError(Abort, EvalError)
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index e3f4521844e8..eee48887dc22 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -31,12 +31,10 @@ namespace nix {
         Path basePath;
         Symbol path;
         string error;
-        bool atEnd;
         Symbol sLetBody;
         ParseData(EvalState & state)
             : state(state)
             , symbols(state.symbols)
-            , atEnd(false)
             , sLetBody(symbols.create("<let-body>"))
             { };
     };
@@ -541,12 +539,7 @@ Expr * EvalState::parse(const char * text,
     int res = yyparse(scanner, &data);
     yylex_destroy(scanner);
 
-    if (res) {
-      if (data.atEnd)
-        throw IncompleteParseError(data.error);
-      else
-        throw ParseError(data.error);
-    }
+    if (res) throw ParseError(data.error);
 
     data.result->bindVars(staticEnv);