X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fcontrol%2Frepeat.c;h=69a29a82085c98f77e26e68ad0f5e941e47b256f;hb=10b7dcaf6f48414b23ab99348835149419b3c971;hp=0a7da0a6cb3237d95b2ac6f3758af60d75a3214e;hpb=65e61cc92b48297625bc71cf31b8a19e301eb6c1;p=pspp-builds.git diff --git a/src/language/control/repeat.c b/src/language/control/repeat.c index 0a7da0a6..69a29a82 100644 --- a/src/language/control/repeat.c +++ b/src/language/control/repeat.c @@ -1,6 +1,5 @@ /* PSPP - computes sample statistics. Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. - Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -311,7 +310,7 @@ parse_lines (struct lexer *lexer, struct repeat_block *block) /* Record file name. */ cur_file_name = getl_source_name (lex_get_source_stream (lexer)); - if (cur_file_name != NULL && + if (cur_file_name != NULL && (previous_file_name == NULL || !strcmp (cur_file_name, previous_file_name))) previous_file_name = pool_strdup (block->pool, cur_file_name); @@ -328,12 +327,18 @@ parse_lines (struct lexer *lexer, struct repeat_block *block) lex_preprocess_line (&text, syntax, &command_ends_before_line, &command_ends_after_line); - if (recognize_do_repeat (ds_ss (&text))) - nesting_level++; + if (recognize_do_repeat (ds_ss (&text))) + { + if (get_syntax () == COMPATIBLE) + msg (SE, _("DO REPEAT may not nest in compatibility mode.")); + else + nesting_level++; + } else if (recognize_end_repeat (ds_ss (&text), &block->print) - && nesting_level-- == 0) + && nesting_level-- == 0) { lex_discard_line (lexer); + ds_destroy (&text); return true; } ds_destroy (&text); @@ -348,7 +353,7 @@ static void create_vars (struct repeat_block *block) { struct repeat_macro *macro; - + ll_for_each (macro, struct repeat_macro, ll, &block->macros) if (macro->type == VAR_NAMES) {