mirror of
git://projects.qi-hardware.com/fped.git
synced 2024-11-18 06:59:43 +02:00
dump.c: add dumping of %iprint
This commit is contained in:
parent
1bc94d0445
commit
1d7eccb06b
9
dump.c
9
dump.c
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* dump.c - Dump objects in the native FPD format
|
||||
*
|
||||
* Written 2009-2012 by Werner Almesberger
|
||||
* Copyright 2009-2012 by Werner Almesberger
|
||||
* Written 2009-2012, 2014 by Werner Almesberger
|
||||
* Copyright 2009-2012, 2014 by Werner Almesberger
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -383,6 +383,11 @@ char *print_obj(const struct obj *obj, const struct vec *prev)
|
||||
}
|
||||
free(s2);
|
||||
break;
|
||||
case ot_iprint:
|
||||
s2 = unparse(obj->u.iprint.expr);
|
||||
s = stralloc_printf("%%iprint %s", s2);
|
||||
free(s2);
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
|
15
test/iprint
15
test/iprint
@ -98,4 +98,19 @@ expect <<EOF
|
||||
undefined variable "foo"
|
||||
EOF
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
fped_dump "iprint: dump" <<EOF
|
||||
%iprint 42
|
||||
EOF
|
||||
expect <<EOF
|
||||
42
|
||||
/* MACHINE-GENERATED ! */
|
||||
|
||||
package "_"
|
||||
unit mm
|
||||
|
||||
%iprint 42
|
||||
EOF
|
||||
|
||||
###############################################################################
|
||||
|
Loading…
Reference in New Issue
Block a user