From: John Darrington Date: Sun, 6 Jan 2013 15:52:58 +0000 (+0100) Subject: GET DATA: Add error message on incorrect syntax X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f59d02c71ed5bb285592c898d5ee3ca0be43c061;p=pspp GET DATA: Add error message on incorrect syntax Previously, when an incorrect syntax reading a spreadsheet file was used, the procedure would silently fail. Now it fails with an error message. --- diff --git a/src/language/data-io/get-data.c b/src/language/data-io/get-data.c index 789300015e..3ae426c84a 100644 --- a/src/language/data-io/get-data.c +++ b/src/language/data-io/get-data.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -230,7 +230,11 @@ parse_spreadsheet (struct lexer *lexer) lex_get (lexer); } else - goto error; + { + msg (SE, _("%s must be followed by either \"%s\" or \"%s\"."), + "/SHEET", "NAME", "INDEX"); + goto error; + } } else if (lex_match_id (lexer, "CELLRANGE")) { @@ -249,7 +253,11 @@ parse_spreadsheet (struct lexer *lexer) lex_get (lexer); } else - goto error; + { + msg (SE, _("%s must be followed by either \"%s\" or \"%s\"."), + "/CELLRANGE", "FULL", "RANGE"); + goto error; + } } else if (lex_match_id (lexer, "READNAMES")) { @@ -264,7 +272,11 @@ parse_spreadsheet (struct lexer *lexer) sri->read_names = false; } else - goto error; + { + msg (SE, _("%s must be followed by either \"%s\" or \"%s\"."), + "/READNAMES", "ON", "OFF"); + goto error; + } } else {