Mercurial > projects > ldc
diff dmd2/parse.c @ 1577:e4f7b5d9c68a
DMD 2.032 Merge.
author | Robert Clipsham <robert@octarineparrot.com> |
---|---|
date | Tue, 08 Sep 2009 10:07:56 +0100 |
parents | 54b3c1394d62 |
children |
line wrap: on
line diff
--- a/dmd2/parse.c Tue Aug 25 21:35:43 2009 +0200 +++ b/dmd2/parse.c Tue Sep 08 10:07:56 2009 +0100 @@ -2266,7 +2266,7 @@ nextToken(); arguments = parseParameters(&varargs); while (1) - { // Postfixes of 'pure' or 'nothrow' + { // Postfixes if (token.value == TOKpure) ispure = true; else if (token.value == TOKnothrow) @@ -2433,6 +2433,22 @@ ((TypeFunction *)tf)->ispure = 1; nextToken(); continue; + + case TOKat: + nextToken(); + if (token.value != TOKidentifier) + { error("attribute identifier expected"); + nextToken(); + continue; + } + Identifier *id = token.ident; + if (id == Id::property) + ((TypeFunction *)tf)->ispure = 1; + else + error("valid attribute identifiers are property, not %s", id->toChars()); + nextToken(); + continue; + } break; } @@ -4361,6 +4377,10 @@ case TOKnothrow: t = peek(t); continue; + case TOKat: + t = peek(t); // skip '@' + t = peek(t); // skip identifier + continue; default: break; }