comparison trunk/src/dil/parser/Parser.d @ 650:eb490ba8dba0

Made AttributeDeclaration abstract.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Tue, 15 Jan 2008 11:22:55 +0100
parents 68953760d569
children 29cc5bf3ce89
comparison
equal deleted inserted replaced
649:3ebe76ad680e 650:eb490ba8dba0
827 if (stc & stc_tmp) 827 if (stc & stc_tmp)
828 error(MID.RedundantStorageClass, token.srcText); 828 error(MID.RedundantStorageClass, token.srcText);
829 else 829 else
830 stc |= stc_tmp; 830 stc |= stc_tmp;
831 831
832 auto tok = token.type;
833 nT(); 832 nT();
834 decl = new StorageClassDeclaration(stc_tmp, tok, parse()); 833 decl = new StorageClassDeclaration(stc_tmp, parse());
835 set(decl, begin); 834 set(decl, begin);
836 break; 835 break;
837 case T.Identifier: 836 case T.Identifier:
838 case_Declaration: 837 case_Declaration:
839 // This could be a normal Declaration or an AutoDeclaration 838 // This could be a normal Declaration or an AutoDeclaration
1784 if (stc & stc_tmp) 1783 if (stc & stc_tmp)
1785 error(MID.RedundantStorageClass, token.srcText); 1784 error(MID.RedundantStorageClass, token.srcText);
1786 else 1785 else
1787 stc |= stc_tmp; 1786 stc |= stc_tmp;
1788 1787
1789 auto tok = token.type;
1790 nT(); 1788 nT();
1791 d = new StorageClassDeclaration(stc_tmp, tok, parse()); 1789 d = new StorageClassDeclaration(stc_tmp, parse());
1792 break; 1790 break;
1793 // TODO: allow "scope class", "abstract scope class" in function bodies? 1791 // TODO: allow "scope class", "abstract scope class" in function bodies?
1794 //case T.Class: 1792 //case T.Class:
1795 default: 1793 default:
1796 case_Declaration: 1794 case_Declaration:
1820 ident = requireIdentifier(MSG.ExpectedVariableName); 1818 ident = requireIdentifier(MSG.ExpectedVariableName);
1821 require(T.Assign); 1819 require(T.Assign);
1822 auto init = parseExpression(); 1820 auto init = parseExpression();
1823 auto v = new VariableDeclaration(null, [ident], [init]); 1821 auto v = new VariableDeclaration(null, [ident], [init]);
1824 set(v, begin.nextNWS); 1822 set(v, begin.nextNWS);
1825 auto d = new StorageClassDeclaration(StorageClass.Auto, T.Auto, v); 1823 auto d = new StorageClassDeclaration(StorageClass.Auto, v);
1826 set(d, begin); 1824 set(d, begin);
1827 variable = new DeclarationStatement(d); 1825 variable = new DeclarationStatement(d);
1828 set(variable, begin); 1826 set(variable, begin);
1829 } 1827 }
1830 else 1828 else