Mercurial > projects > dil
comparison trunk/src/dil/parser/ImportParser.d @ 734:b11d46260909
Fixed infinite loop in ImportParser.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Sun, 03 Feb 2008 21:13:44 +0100 |
parents | 7541c64fc423 |
children | 90668b83ae5e |
comparison
equal
deleted
inserted
replaced
733:a48255f547c1 | 734:b11d46260909 |
---|---|
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 bool skipToClosing(T opening, T closing) | 59 bool skipToClosing(T opening, T closing) |
60 { | 60 { |
61 Token* next = token; | 61 alias token next; |
62 uint level = 1; | 62 uint level = 1; |
63 while (1) | 63 while (1) |
64 { | 64 { |
65 lexer.peek(next); | 65 lexer.peek(next); |
66 if (next.kind == opening) | 66 if (next.kind == opening) |
255 goto case_Declaration; | 255 goto case_Declaration; |
256 } | 256 } |
257 else | 257 else |
258 goto case_InvariantAttribute; | 258 goto case_InvariantAttribute; |
259 } | 259 } |
260 nT(); | |
260 token.kind == T.LParen && skipToTokenAfterClosingParen(); | 261 token.kind == T.LParen && skipToTokenAfterClosingParen(); |
261 parseFunctionBody(); | 262 parseFunctionBody(); |
262 break; | 263 break; |
263 case T.Unittest: | 264 case T.Unittest: |
264 nT(); | 265 nT(); |