Mercurial > projects > dil
changeset 163:f27a98bb17c7
- Fix: when parsing Declarator fails, type and ident is set to null.
- Added an opEquals method to Token.
author | aziz |
---|---|
date | Fri, 13 Jul 2007 22:41:03 +0000 |
parents | c7b250662c74 |
children | 8ec99326752b |
files | trunk/src/Parser.d trunk/src/Token.d |
diffstat | 2 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/trunk/src/Parser.d Fri Jul 13 22:31:02 2007 +0000 +++ b/trunk/src/Parser.d Fri Jul 13 22:41:03 2007 +0000 @@ -1196,6 +1196,11 @@ { require(T.Assign); } + else + { + type = null; + ident = null; + } } condition = parseExpression(); require(T.RParen);
--- a/trunk/src/Token.d Fri Jul 13 22:31:02 2007 +0000 +++ b/trunk/src/Token.d Fri Jul 13 22:41:03 2007 +0000 @@ -132,8 +132,12 @@ bool isKeyword() { - if (KeywordsBegin <= type && type <= KeywordsEnd) - return true; - return false; + return KeywordsBegin <= type && type <= KeywordsEnd; } +/+ + int opEquals(TOK type2) + { + return type == type2; + } ++/ } \ No newline at end of file