1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-06-29 00:17:19 +03:00

%dump didn't dump the root frame because this frame was only appended to the

list of frames at the end of parsing. We now tentatively append it each time
a %dump is requested.

- fpd.y: append the root frame before calling "dump"



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5921 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
werner 2010-04-19 22:57:51 +00:00
parent 6374b3a61a
commit e24b9de387

23
fpd.y
View File

@ -249,6 +249,16 @@ static int dbg_print(const struct expr *expr)
}
static void append_root_frame(void)
{
root_frame->prev = last_frame;
if (last_frame)
last_frame->next = root_frame;
else
frames = root_frame;
}
%}
@ -311,11 +321,7 @@ all:
}
fpd
{
root_frame->prev = last_frame;
if (last_frame)
last_frame->next = root_frame;
else
frames = root_frame;
append_root_frame();
}
| START_EXPR expr
{
@ -455,6 +461,13 @@ frame_item:
}
| TOK_DBG_DUMP
{
/*
* It's okay to do append the root frame multiple
* times. If more frames are added afterwards, they
* just replace the root frame until it gets appended a
* final time when parsing ends.
*/
append_root_frame();
if (!dump(stdout)) {
perror("stdout");
exit(1);