Skip to content
Snippets Groups Projects
Commit 3b7ed377 authored by dcw's avatar dcw
Browse files

fixed print list and print item stuff.

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