summaryrefslogtreecommitdiff
path: root/src/parser/parser.cpp
diff options
context:
space:
mode:
authorChristopher L. Conway <christopherleeconway@gmail.com>2010-07-28 22:57:36 +0000
committerChristopher L. Conway <christopherleeconway@gmail.com>2010-07-28 22:57:36 +0000
commit88766918615793536224bf50d0bb70ec9f9efd93 (patch)
tree5a038bb2c17199f43d7a422063751bc3839b7388 /src/parser/parser.cpp
parentd2787f41e72184fbdf2619d3c0466bed9b6211be (diff)
Forcing a type check on Node construction in debug mode (Fixes: #188)
NOTE: mkNode/mkExpr/parsing functions can now throw type checking exceptions
Diffstat (limited to 'src/parser/parser.cpp')
-rw-r--r--src/parser/parser.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/parser/parser.cpp b/src/parser/parser.cpp
index 2bad12e2c..f73e268a3 100644
--- a/src/parser/parser.cpp
+++ b/src/parser/parser.cpp
@@ -234,6 +234,11 @@ Command* Parser::nextCommand() throw(ParserException) {
} catch(ParserException& e) {
setDone();
throw;
+ } catch(TypeCheckingException& e) {
+ setDone();
+ stringstream ss;
+ ss << e.getMessage() << ": " << e.getExpression();
+ parseError( ss.str() );
}
}
Debug("parser") << "nextCommand() => " << cmd << std::endl;
@@ -252,6 +257,11 @@ Expr Parser::nextExpression() throw(ParserException) {
} catch(ParserException& e) {
setDone();
throw;
+ } catch(TypeCheckingException& e) {
+ setDone();
+ stringstream ss;
+ ss << e.getMessage() << ": " << e.getExpression();
+ parseError( ss.str() );
}
}
Debug("parser") << "nextExpression() => " << result << std::endl;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback