



ReviseMulti (lines 3270-3316)
Back to List
Browsing parserm.h
3270 ! ReviseMulti revises the multiple object which already exists, in the
3271 ! light of information which has come along since then (i.e., the second
3272 ! parameter). It returns a parser error number, or else 0 if all is well.
3273 ! This only ever throws things out, never adds new ones.
3274 ! ----------------------------------------------------------------------------
3275
3276 [ ReviseMulti second_p i low;
3277 #Ifdef DEBUG;
3278 if (parser_trace >= 4) print " Revising multiple object list of size ", multiple_object-->0,
3279 " with 2nd ", (name) second_p, "^";
3280 #Endif; ! DEBUG
3281
3282 if (multi_context == MULTIEXCEPT_TOKEN or MULTIINSIDE_TOKEN) {
3283 for (i=1,low=0 : i<=multiple_object-->0 : i++) {
3284 if ( (multi_context==MULTIEXCEPT_TOKEN && multiple_object-->i ~= second_p) ||
3285 (multi_context==MULTIINSIDE_TOKEN && multiple_object-->i in second_p)) {
3286 low++;
3287 multiple_object-->low = multiple_object-->i;
3288 }
3289 }
3290 multiple_object-->0 = low;
3291 }
3292
3293 if (multi_context == MULTI_TOKEN && action_to_be == ##Take) {
3294 for (i=1,low=0 : i<=multiple_object-->0 : i++)
3295 if (ScopeCeiling(multiple_object-->i)==ScopeCeiling(actor)) low++;
3296 #Ifdef DEBUG;
3297 if (parser_trace >= 4) print " Token 2 plural case: number with actor ", low, "^";
3298 #Endif; ! DEBUG
3299 if (take_all_rule == 2 || low > 0) {
3300 for (i=1,low=0 : i<=multiple_object-->0 : i++) {
3301 if (ScopeCeiling(multiple_object-->i) == ScopeCeiling(actor)) {
3302 low++;
3303 multiple_object-->low = multiple_object-->i;
3304 }
3305 }
3306 multiple_object-->0 = low;
3307 }
3308 }
3309
3310 i = multiple_object-->0;
3311 #Ifdef DEBUG;
3312 if (parser_trace >= 4) print " Done: new size ", i, "^";
3313 #Endif; ! DEBUG
3314 if (i == 0) return NOTHING_PE;
3315 return 0;
3316 ];
Last updated 27 February 2004. The librarian in charge of this page is Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight. Please email any comments, suggestions or corrections to cedenqs@inform-fiction.org.