Mercurial > projects > ldc
diff dmd/attrib.c @ 1392:336faed34424
Allow ignored pragmas to have a body; don't ignore the body.
Also, ignore errors while trying to make sense of parameters to ignored pragmas
for -v.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sun, 17 May 2009 23:33:35 +0200 |
parents | 229e02867307 |
children | def7a1d494fd |
line wrap: on
line diff
--- a/dmd/attrib.c Sun May 17 23:15:04 2009 +0200 +++ b/dmd/attrib.c Sun May 17 23:33:35 2009 +0200 @@ -1012,6 +1012,10 @@ { for (size_t i = 0; i < args->dim; i++) { + // ignore errors in ignored pragmas. + global.gag++; + unsigned errors_save = global.errors; + Expression *e = (Expression *)args->data[i]; e = e->semantic(sc); e = e->optimize(WANTvalue | WANTinterpret); @@ -1020,13 +1024,16 @@ else printf(","); printf("%s", e->toChars()); + + // restore error state. + global.gag--; + global.errors = errors_save; } if (args->dim) printf(")"); } printf("\n"); } - goto Lnodecl; } else error("unrecognized pragma(%s)", ident->toChars());