Inform - Support - Source

Back to List

Inventory
Complete

Backward
Forward

Plain
Coloured
Gaudy

This code
in plain text

Browsing parserm.h

ReviseMulti (lines 2538-2589)

2538  !  ReviseMulti  revises the multiple object which already exists, in the
2539  !    light of information which has come along since then (i.e., the second
2540  !    parameter).  It returns a parser error number, or else 0 if all is well.
2541  !    This only ever throws things out, never adds new ones.
2542  ! ----------------------------------------------------------------------------
2543   
2544  [ ReviseMulti second_p  i low;
2545   
2546  #ifdef DEBUG;
2547    if (parser_trace>=4)
2548        print "   Revising multiple object list of size ", multiple_object-->0,
2549              " with 2nd ", (name) second_p, "^";
2550  #endif;
2551   
2552    if (multi_context==MULTIEXCEPT_TOKEN or MULTIINSIDE_TOKEN)
2553    {   for (i=1, low=0:i<=multiple_object-->0:i++)
2554        {   if ( (multi_context==MULTIEXCEPT_TOKEN
2555                  && multiple_object-->i ~= second_p)
2556                 || (multi_context==MULTIINSIDE_TOKEN
2557                     && multiple_object-->i in second_p))
2558            {   low++; multiple_object-->low = multiple_object-->i;
2559            }
2560        }
2561        multiple_object-->0 = low;
2562    }
2563   
2564    if (multi_context==MULTI_TOKEN && action_to_be == ##Take)
2565    {   for (i=1, low=0:i<=multiple_object-->0:i++)
2566            if (ScopeCeiling(multiple_object-->i)==ScopeCeiling(actor))
2567                low++;
2568  #ifdef DEBUG;
2569        if (parser_trace>=4)
2570            print "   Token 2 plural case: number with actor ", low, "^";
2571  #endif;
2572        if (take_all_rule==2 || low>0)
2573        {   for (i=1, low=0:i<=multiple_object-->0:i++)
2574            {   if (ScopeCeiling(multiple_object-->i)==ScopeCeiling(actor))
2575                {   low++; multiple_object-->low = multiple_object-->i;
2576                }
2577            }
2578            multiple_object-->0 = low;
2579        }
2580    }
2581   
2582    i=multiple_object-->0;
2583  #ifdef DEBUG;
2584    if (parser_trace>=4)
2585        print "   Done: new size ", i, "^";
2586  #endif;
2587    if (i==0) return NOTHING_PE;
2588    return 0;
2589  ];


Last updated 27 February 2004. This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation. Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight.