Revert "Throw a specific error for incomplete parse errors."
This reverts commit 6498adb002
. We don't
actually use IncompleteParseError in 'nix repl'.
This commit is contained in:
parent
2b3c1b3a88
commit
f3c85f9eb3
3 changed files with 1 additions and 11 deletions
|
@ -213,7 +213,5 @@ or { return OR_KW; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<<EOF>> { data->atEnd = true; return 0; }
|
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ namespace nix {
|
||||||
|
|
||||||
MakeError(EvalError, Error)
|
MakeError(EvalError, Error)
|
||||||
MakeError(ParseError, Error)
|
MakeError(ParseError, Error)
|
||||||
MakeError(IncompleteParseError, ParseError)
|
|
||||||
MakeError(AssertionError, EvalError)
|
MakeError(AssertionError, EvalError)
|
||||||
MakeError(ThrownError, AssertionError)
|
MakeError(ThrownError, AssertionError)
|
||||||
MakeError(Abort, EvalError)
|
MakeError(Abort, EvalError)
|
||||||
|
|
|
@ -31,12 +31,10 @@ namespace nix {
|
||||||
Path basePath;
|
Path basePath;
|
||||||
Symbol path;
|
Symbol path;
|
||||||
string error;
|
string error;
|
||||||
bool atEnd;
|
|
||||||
Symbol sLetBody;
|
Symbol sLetBody;
|
||||||
ParseData(EvalState & state)
|
ParseData(EvalState & state)
|
||||||
: state(state)
|
: state(state)
|
||||||
, symbols(state.symbols)
|
, symbols(state.symbols)
|
||||||
, atEnd(false)
|
|
||||||
, sLetBody(symbols.create("<let-body>"))
|
, sLetBody(symbols.create("<let-body>"))
|
||||||
{ };
|
{ };
|
||||||
};
|
};
|
||||||
|
@ -541,12 +539,7 @@ Expr * EvalState::parse(const char * text,
|
||||||
int res = yyparse(scanner, &data);
|
int res = yyparse(scanner, &data);
|
||||||
yylex_destroy(scanner);
|
yylex_destroy(scanner);
|
||||||
|
|
||||||
if (res) {
|
if (res) throw ParseError(data.error);
|
||||||
if (data.atEnd)
|
|
||||||
throw IncompleteParseError(data.error);
|
|
||||||
else
|
|
||||||
throw ParseError(data.error);
|
|
||||||
}
|
|
||||||
|
|
||||||
data.result->bindVars(staticEnv);
|
data.result->bindVars(staticEnv);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue