summaryrefslogtreecommitdiff
path: root/src/parser/parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser/parser.cpp')
-rw-r--r--src/parser/parser.cpp36
1 files changed, 14 insertions, 22 deletions
diff --git a/src/parser/parser.cpp b/src/parser/parser.cpp
index 8b77362b2..90f17426b 100644
--- a/src/parser/parser.cpp
+++ b/src/parser/parser.cpp
@@ -446,26 +446,20 @@ Command* Parser::nextCommand() throw(ParserException) {
if(!d_commandQueue.empty()) {
cmd = d_commandQueue.front();
d_commandQueue.pop_front();
- if(cmd == NULL) {
- setDone();
- }
+ setDone(cmd == NULL);
} else {
- if(!done()) {
- try {
- cmd = d_input->parseCommand();
- d_commandQueue.push_back(cmd);
- cmd = d_commandQueue.front();
- d_commandQueue.pop_front();
- if(cmd == NULL) {
- setDone();
- }
- } catch(ParserException& e) {
- setDone();
- throw;
- } catch(exception& e) {
- setDone();
- parseError(e.what());
- }
+ try {
+ cmd = d_input->parseCommand();
+ d_commandQueue.push_back(cmd);
+ cmd = d_commandQueue.front();
+ d_commandQueue.pop_front();
+ setDone(cmd == NULL);
+ } catch(ParserException& e) {
+ setDone();
+ throw;
+ } catch(exception& e) {
+ setDone();
+ parseError(e.what());
}
}
Debug("parser") << "nextCommand() => " << cmd << std::endl;
@@ -478,9 +472,7 @@ Expr Parser::nextExpression() throw(ParserException) {
if(!done()) {
try {
result = d_input->parseExpr();
- if(result.isNull()) {
- setDone();
- }
+ setDone(result.isNull());
} catch(ParserException& e) {
setDone();
throw;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback