Commit 3b7ed377 authored by dcw's avatar dcw

fixed print list and print item stuff.

parent c21a9cd3
......@@ -13,10 +13,10 @@
* declns = ne-list( decln ) tEOF
* decln = tID tEQ shapes tSEMI
* shapes = ne-sep-list( shape, tOR )
* shape = tID [ tOPENBR params tCLOSEBR ] [ list( printitem ) ]
* shape = tID [ tOPENBR params tCLOSEBR ] printlist
* params = ne-sep-list( param, tCOMMA )
* param = tID tID
* printitem = tSTR | tNUM
* printlist = list( tSTR | tNUM )
*/
......@@ -108,7 +108,7 @@ static BOOL parse_shapes( sp ) shapelist *sp;
}
/* shape = tID [ tOPENBR params tCLOSEBR ] [ printlist ] */
/* shape = tID [ tOPENBR params tCLOSEBR ] printlist */
static BOOL parse_shape( tagname, pl, print ) char **tagname; paramlist *pl; printlist *print;
{
......@@ -118,19 +118,17 @@ static BOOL parse_shape( tagname, pl, print ) char **tagname; paramlist *pl; pri
MUSTBE( tID, "shape name" );
COPYOF( *tagname, lexidval );
if( nexttok() != tOPENBR )
if( nexttok() == tOPENBR )
{
if( ! parse_params( pl ) ) return FALSE;
MUSTBE( tCLOSEBR, "')'" );
} else
{
ungettok();
return TRUE;
}
if( ! parse_params( pl ) ) return FALSE;
MUSTBE( tCLOSEBR, "')'" );
if( ! parse_printlist( print ) ) return FALSE;
return TRUE;
return parse_printlist( print );
}
......@@ -174,9 +172,12 @@ static BOOL parse_printlist( pp ) printlist *pp;
static BOOL parse_printitem( item ) printitem *item;
{
char *temp;
switch( nexttok() ) {
case tSTR:
*item = build_printitem_str( lexidval );
COPYOF( temp, lexidval );
*item = build_printitem_str( temp );
return TRUE;
case tNUM:
*item = build_printitem_num( lexintval );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment