X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fcontrol%2Frepeat.c;h=69c92ac108c439ebf141242a5565281070d60861;hb=d8ffe656444590f1199f62ac3ebdb9b7692923c2;hp=cd88a1e141884121f691b812a496a19fb77f698f;hpb=173d1687aea88e0e5e1b1d8615ed68ebefb15d08;p=pspp diff --git a/src/language/control/repeat.c b/src/language/control/repeat.c index cd88a1e141..69c92ac108 100644 --- a/src/language/control/repeat.c +++ b/src/language/control/repeat.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2007, 2009 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2007, 2009, 2010 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 @@ -195,7 +195,7 @@ parse_specification (struct lexer *lexer, struct repeat_block *block) count = parse_ids (lexer, dict, macro, block->pool); else if (lex_is_number (lexer)) count = parse_numbers (lexer, macro, block->pool); - else if (lex_token (lexer) == T_STRING) + else if (lex_is_string (lexer)) count = parse_strings (lexer, macro, block->pool); else { @@ -306,7 +306,10 @@ parse_lines (struct lexer *lexer, struct repeat_block *block) /* Retrieve an input line and make a copy of it. */ if (!lex_get_line_raw (lexer)) - return false; + { + msg (SE, _("DO REPEAT without END REPEAT.")); + return false; + } ds_init_string (&text, lex_entire_line_ds (lexer)); /* Record file name. */ @@ -476,7 +479,7 @@ parse_strings (struct lexer *lexer, struct repeat_macro *macro, struct pool *poo { char *string; - if (lex_token (lexer) != T_STRING) + if (!lex_force_string (lexer)) { msg (SE, _("String expected.")); return 0; @@ -618,10 +621,10 @@ do_repeat_name (const struct getl_interface *interface) } /* Returns the line number in the source file from which the - previous line was originally obtained, or -1 if none. */ + previous line was originally obtained, or 0 if none. */ static int do_repeat_location (const struct getl_interface *interface) { struct repeat_line *line = current_line (interface); - return line ? line->line_number : -1; + return line ? line->line_number : 0; }