Changeset 628


Ignore:
Timestamp:
1999-09-24T14:25:35+12:00 (25 years ago)
Author:
rjmcnab
Message:

removed limitation on the number of arguments that a macro can have

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/lib/display.cpp

    r534 r628  
    2828/*
    2929   $Log$
     30   Revision 1.15  1999/09/24 02:25:35  rjmcnab
     31   removed limitation on the number of arguments that a macro can have
     32
    3033   Revision 1.14  1999/09/07 04:57:41  sjboddie
    3134   added gpl notice
     
    15611564        {
    15621565          text_t::const_iterator savedhereit = hereit;
    1563           unsigned short c2 = my_ttnextchar (hereit, endit);
    1564           unsigned short c3 = my_ttnextchar (hereit, endit);
    1565           if ((c2 >= '1') && (c2 <= '9') && (c3 == '_'))
    1566         {
    1567           // found an option macro, append the appropriate text
    1568           text_tlist::iterator ttlisthere = splitmacroparam.begin();
    1569           text_tlist::iterator ttlistend = splitmacroparam.end();
    1570           while ((c2 > '1') && (ttlisthere != ttlistend))
    1571             {
    1572               c2--;
    1573               ttlisthere++;
    1574             }
    1575           if (ttlisthere != ttlistend) {
    1576             tempmacrovalue.append(*ttlisthere);
    1577             if (findchar((*ttlisthere).begin(), (*ttlisthere).end(), '_') != (*ttlisthere).end())
    1578               needsexpansion = true;
    1579           }
    1580 
    1581           c = my_ttnextchar (hereit, endit);
    1582 
     1566
     1567          // attempt to get a number
     1568          int argnum = 0;
     1569          unsigned short digc = my_ttnextchar (hereit, endit);
     1570          while (digc >= '0' && digc <= '9') {
     1571        argnum = argnum*10 + digc - '0';
     1572        digc = my_ttnextchar (hereit, endit);
     1573          }
     1574          if (digc == '_' && argnum > 0) {
     1575        // found an option macro, append the appropriate text
     1576        text_tlist::iterator ttlisthere = splitmacroparam.begin();
     1577        text_tlist::iterator ttlistend = splitmacroparam.end();
     1578        while ((argnum > 1) && (ttlisthere != ttlistend)) {
     1579          argnum--;
     1580          ttlisthere++;
    15831581        }
    1584           else
    1585         {
    1586           // wasn't a option macro
    1587           needsexpansion = true;
    1588           tempmacrovalue.push_back(c);
    1589           hereit = savedhereit;
    1590           c = my_ttnextchar (hereit, endit);
     1582        if (ttlisthere != ttlistend) {
     1583          tempmacrovalue.append(*ttlisthere);
     1584          if (findchar((*ttlisthere).begin(), (*ttlisthere).end(), '_') != (*ttlisthere).end())
     1585            needsexpansion = true;
    15911586        }
     1587
     1588        c = my_ttnextchar (hereit, endit);
     1589
     1590          } else {
     1591        // wasn't a option macro
     1592        needsexpansion = true;
     1593        tempmacrovalue.push_back(c);
     1594        hereit = savedhereit;
     1595        c = my_ttnextchar (hereit, endit);
     1596          }
    15921597        }
    15931598      else
Note: See TracChangeset for help on using the changeset viewer.