]> git.mdlowis.com Git - archive/dlang.git/commitdiff
Updated parse-utils and updated to the newer, cleaner, exception interface
authorMike D. Lowis <mike@mdlowis.com>
Tue, 13 Mar 2012 16:55:56 +0000 (12:55 -0400)
committerMike D. Lowis <mike@mdlowis.com>
Tue, 13 Mar 2012 16:55:56 +0000 (12:55 -0400)
deps/parse-utils
res/DUMMY [deleted file]
res/environment.scm
source/dllexer/dllexer.cpp
source/dlparser/dlparser.cpp

index b0133e031a5d1419f58e8df36cc5eb56624089a6..f54599839bb91b6219b4c0a5063eed0380b880a5 160000 (submodule)
@@ -1 +1 @@
-Subproject commit b0133e031a5d1419f58e8df36cc5eb56624089a6
+Subproject commit f54599839bb91b6219b4c0a5063eed0380b880a5
diff --git a/res/DUMMY b/res/DUMMY
deleted file mode 100644 (file)
index e69de29..0000000
index a1993676f8e7ec76f6d53e815f56cb2a031ceec5..896e7ee5e1ab425d4e855b15578b8c9648357bf4 100644 (file)
 ; 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))
+
index 6186adb97d8bca6863c7c5c5708e82319903af89..d4ea3fb373424d5529cb97ddec56eb74c62136b2 100644 (file)
@@ -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;
     }
 }
index 7334642c3f5599c64af4a8e3f85acf132d1a5354..2c49bc995999e8d2b68944e3e0fb6e08cb00c0ee 100644 (file)
@@ -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 );