[Nickle] nickle: Branch 'master'

Bart Massey bart at keithp.com
Thu Nov 19 11:29:40 PST 2009


 string.5c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 3111c1bbe21202ca13b0c3bba39ce61b87197269
Author: Bart Massey <bart at cs.pdx.edu>
Date:   Thu Nov 19 11:29:36 2009 -0800

    changd csv parser to throw a bad_csv_parse exception on unclosed quotes

diff --git a/string.5c b/string.5c
index 1a234ea..52bae33 100644
--- a/string.5c
+++ b/string.5c
@@ -190,6 +190,9 @@ extend namespace String {
 
     public typedef (string[*])(string) parse_csv_t;
 
+    public exception bad_csv_parse(string error_msg,
+    	   	                   string[*] partial_parse);
+
     public parse_csv_t make_parse_csv(quote_context q) 
 	/*
 	 * Construct a CSV file parsing context from 'q'
@@ -240,8 +243,8 @@ extend namespace String {
 		cur++;
 	    }
 	    if (t == qstate.openq)
-		raise invalid_argument("parse_csv: unexpected " +
-				       "end of csv line", 0, s);
+		raise bad_csv_parse("parse_csv: unexpected " +
+				    "end of csv line", ss);
 	    consume();
 	    return ss;
 	}


More information about the Nickle mailing list