diff options
author | Christopher L. Conway <christopherleeconway@gmail.com> | 2010-07-28 22:57:36 +0000 |
---|---|---|
committer | Christopher L. Conway <christopherleeconway@gmail.com> | 2010-07-28 22:57:36 +0000 |
commit | 88766918615793536224bf50d0bb70ec9f9efd93 (patch) | |
tree | 5a038bb2c17199f43d7a422063751bc3839b7388 /src/parser/parser.cpp | |
parent | d2787f41e72184fbdf2619d3c0466bed9b6211be (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.cpp | 10 |
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; |