Mercurial > projects > dil
comparison trunk/src/dil/Parser.d @ 488:cfb3805768b6
Added DotExpression and DotType.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Sat, 01 Dec 2007 21:42:24 +0100 |
parents | bd176bc73e43 |
children | a7291d3ee9d7 |
comparison
equal
deleted
inserted
replaced
487:bccca748d745 | 488:cfb3805768b6 |
---|---|
808 break; | 808 break; |
809 case T.Pragma: | 809 case T.Pragma: |
810 // Pragma: | 810 // Pragma: |
811 // pragma ( Identifier ) | 811 // pragma ( Identifier ) |
812 // pragma ( Identifier , ExpressionList ) | 812 // pragma ( Identifier , ExpressionList ) |
813 // ExpressionList: | |
814 // AssignExpression | |
815 // AssignExpression , ExpressionList | |
816 nT(); | 813 nT(); |
817 Token* ident; | 814 Token* ident; |
818 Expression[] args; | 815 Expression[] args; |
819 Declaration decls; | 816 Declaration decls; |
820 | 817 |
1435 assert(token.type == T.Identifier || token.type == T.Dot || token.type == T.Typeof); | 1432 assert(token.type == T.Identifier || token.type == T.Dot || token.type == T.Typeof); |
1436 auto begin = token; | 1433 auto begin = token; |
1437 Expression[] identList; | 1434 Expression[] identList; |
1438 if (token.type == T.Dot) | 1435 if (token.type == T.Dot) |
1439 { | 1436 { |
1440 identList ~= set(new IdentifierExpression(token), begin); | 1437 nT(); |
1441 nT(); | 1438 identList ~= set(new DotExpression(), begin); |
1442 } | 1439 } |
1443 else if (token.type == T.Typeof) | 1440 else if (token.type == T.Typeof) |
1444 { | 1441 { |
1445 requireNext(T.LParen); | 1442 requireNext(T.LParen); |
1446 auto type = new TypeofType(parseExpression()); | 1443 auto type = new TypeofType(parseExpression()); |
1502 { | 1499 { |
1503 auto begin = token; | 1500 auto begin = token; |
1504 Type[] identList; | 1501 Type[] identList; |
1505 if (token.type == T.Dot) | 1502 if (token.type == T.Dot) |
1506 { | 1503 { |
1507 identList ~= set(new IdentifierType(token), begin); | 1504 nT(); |
1508 nT(); | 1505 identList ~= set(new DotType(), begin); |
1509 } | 1506 } |
1510 else if (token.type == T.Typeof) | 1507 else if (token.type == T.Typeof) |
1511 { | 1508 { |
1512 requireNext(T.LParen); | 1509 requireNext(T.LParen); |
1513 auto type = new TypeofType(parseExpression()); | 1510 auto type = new TypeofType(parseExpression()); |
1570 Token* mixinIdent; | 1567 Token* mixinIdent; |
1571 | 1568 |
1572 // This code is similar to parseDotListType(). | 1569 // This code is similar to parseDotListType(). |
1573 if (token.type == T.Dot) | 1570 if (token.type == T.Dot) |
1574 { | 1571 { |
1575 templateIdent ~= set(new IdentifierExpression(token), begin); | 1572 nT(); |
1576 nT(); | 1573 templateIdent ~= set(new DotExpression(), begin); |
1577 } | 1574 } |
1578 | 1575 |
1579 while (1) | 1576 while (1) |
1580 { | 1577 { |
1581 begin = token; | 1578 begin = token; |