From: Mike D. Lowis Date: Tue, 13 Mar 2012 16:55:56 +0000 (-0400) Subject: Updated parse-utils and updated to the newer, cleaner, exception interface X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=c4131ace3267d065d6eaadd11f51c3c27ad9fcda;p=archive%2Fdlang.git Updated parse-utils and updated to the newer, cleaner, exception interface --- diff --git a/deps/parse-utils b/deps/parse-utils index b0133e0..f545998 160000 --- a/deps/parse-utils +++ b/deps/parse-utils @@ -1 +1 @@ -Subproject commit b0133e031a5d1419f58e8df36cc5eb56624089a6 +Subproject commit f54599839bb91b6219b4c0a5063eed0380b880a5 diff --git a/res/DUMMY b/res/DUMMY deleted file mode 100644 index e69de29..0000000 diff --git a/res/environment.scm b/res/environment.scm index a199367..896e7ee 100644 --- a/res/environment.scm +++ b/res/environment.scm @@ -222,3 +222,14 @@ ; Start User Defined Code ;------------------------------------------------------------------------------ +; Potential implementation of prototype objects +;(define Proto +; (list (make-hash-table))) +; +;(define (proto-clone p) +; (list (make-hash-table) p)) +; +;(define (proto? p)) +;(define (proto-value p)) +;(define (proto-member name)) + diff --git a/source/dllexer/dllexer.cpp b/source/dllexer/dllexer.cpp index 6186adb..d4ea3fb 100644 --- a/source/dllexer/dllexer.cpp +++ b/source/dllexer/dllexer.cpp @@ -166,7 +166,7 @@ void DLLexer::Decimal(Token& tok, std::ostringstream& oss) if(!isDigit()) { Exception ex(line,column); - ex.setMessage("Missing fractional portion of floating point number."); + ex << "Missing fractional portion of floating point number."; throw ex; } @@ -193,7 +193,7 @@ void DLLexer::Char(Token& tok) else { Exception ex(line,column); - ex.setMessage("Invalid character literal."); + ex << "Invalid character literal."; throw ex; } match('\''); @@ -241,7 +241,9 @@ void DLLexer::SingleCharOp(Token& tok) if( tok.type() == EOF) { - throw Exception(line,column); + Exception ex(line,column); + ex << "Unrecognized token"; + throw ex; } } @@ -343,6 +345,8 @@ void DLLexer::MultiCharOp(Token& tok) } else { - throw Exception(line,column); + Exception ex(line,column); + ex << "Unexpected token"; + throw ex; } } diff --git a/source/dlparser/dlparser.cpp b/source/dlparser/dlparser.cpp index 7334642..2c49bc9 100644 --- a/source/dlparser/dlparser.cpp +++ b/source/dlparser/dlparser.cpp @@ -139,7 +139,7 @@ AST* DLParser::MacroPatternMatch(Pattern patt) break; default: - throw Exception(lookaheadToken(1).line(), lookaheadToken(1).column()); + throw Exception( lookaheadToken(1) ); break; } @@ -410,11 +410,8 @@ AST* DLParser::Literal(void) break; default: - Token& tok = lookaheadToken(1); - ostringstream oss; - oss << "Expected literal type, recieved type " << tok.type() << "."; - Exception ex( tok.line(), tok.column() ); - ex.setMessage(oss.str()); + Exception ex( lookaheadToken(1) ); + ex << "Expected literal type, recieved type " << lookaheadToken(1).type() << "."; throw ex; } } @@ -545,7 +542,7 @@ Pattern DLParser::MacroPattern(void) } else { - throw Exception(lookaheadToken(1).line(), lookaheadToken(1).column()); + throw Exception( lookaheadToken(1) ); } } while( lookaheadType(1) == ID );