1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2025-04-21 12:27:27 +03:00

b2/: assigments to can express inequalities

This commit is contained in:
Werner Almesberger
2012-05-20 23:16:51 -03:00
parent a34702cd8d
commit 6fd5313917
8 changed files with 42 additions and 20 deletions

View File

@@ -21,6 +21,7 @@
#include "util.h"
#include "vstring.h"
#include "lang.h"
#include "relop.h"
#include "subst.h"
@@ -226,12 +227,13 @@ static struct chunk *parse_pattern(const char *s)
}
struct subst *subst_assign(const char *dst, const char *pat)
struct subst *subst_assign(const char *dst, enum relop op, const char *pat)
{
struct subst *sub;
sub = alloc_subst(st_assign);
sub->u.assign.dst = dst;
sub->u.assign.op = op;
sub->u.assign.pat = parse_pattern(pat);
return sub;
}
@@ -358,7 +360,8 @@ static void recurse_dump(FILE *file, const struct subst *sub, int level)
fprintf(file, "%*s}\n", INDENT*level, "");
break;
case st_assign:
fprintf(file, "%s=", sub->u.assign.dst);
fprintf(file, "%s", sub->u.assign.dst);
dump_relop(file, sub->u.assign.op);
dump_chunks(file, sub->u.assign.pat);
fprintf(file, "\n");
break;