X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fcontrol%2Fdo-if.c;h=2e1e0abf5f4deb412db249189cb489b298f72e0d;hb=24d4c143974d0cf3258fe2d355695e820c4ff24e;hp=cb4207846c3bdc2b39ce4e6503fead8233fd1810;hpb=873165af1d9ae450483816b892aa17afd669a7c0;p=pspp-builds.git diff --git a/src/language/control/do-if.c b/src/language/control/do-if.c index cb420784..2e1e0abf 100644 --- a/src/language/control/do-if.c +++ b/src/language/control/do-if.c @@ -82,8 +82,7 @@ struct do_if_trns static const struct ctl_class do_if_class; static int parse_clause (struct lexer *, struct do_if_trns *, struct dataset *ds); -static void add_clause (struct do_if_trns *, - struct expression *condition, int target_index); +static void add_clause (struct do_if_trns *, struct expression *condition); static void add_else (struct do_if_trns *); static bool has_else (struct do_if_trns *); @@ -165,7 +164,7 @@ static void add_else (struct do_if_trns *do_if) { assert (!has_else (do_if)); - add_clause (do_if, NULL, next_transformation (do_if->ds)); + add_clause (do_if, NULL); } /* Returns true if DO_IF does not yet have an ELSE clause. @@ -203,16 +202,16 @@ parse_clause (struct lexer *lexer, struct do_if_trns *do_if, struct dataset *ds) if (condition == NULL) return CMD_CASCADING_FAILURE; - add_clause (do_if, condition, next_transformation (ds)); + add_clause (do_if, condition); return lex_end_of_command (lexer); } /* Adds a clause to DO_IF that tests for the given CONDITION and, - if true, jumps to TARGET_INDEX. */ + if true, jumps to the set of transformations produced by + following commands. */ static void -add_clause (struct do_if_trns *do_if, - struct expression *condition, int target_index) +add_clause (struct do_if_trns *do_if, struct expression *condition) { struct clause *clause; @@ -223,7 +222,7 @@ add_clause (struct do_if_trns *do_if, do_if->clause_cnt + 1, sizeof *do_if->clauses); clause = &do_if->clauses[do_if->clause_cnt++]; clause->condition = condition; - clause->target_index = target_index; + clause->target_index = next_transformation (do_if->ds); } /* Finalizes DO IF by clearing the control stack, thus ensuring