comparison trunk/src/dil/Parser.d @ 535:bdd49ad84f5f

Fixed parsing bug in parseVariableOrFunction().
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Tue, 18 Dec 2007 00:32:30 +0100
parents 50e64bab9c7a
children 0781ac288537
comparison
equal deleted inserted replaced
534:581b3cf3fe8f 535:bdd49ad84f5f
506 d.setStorageClass(stc); 506 d.setStorageClass(stc);
507 d.setLinkageType(linkType); 507 d.setLinkageType(linkType);
508 d.setProtection(protection); 508 d.setProtection(protection);
509 return set(d, begin); 509 return set(d, begin);
510 } 510 }
511 // Type VariableName DeclaratorSuffix 511 else
512 ident = requireIdentifier(MSG.ExpectedVariableName); 512 {
513 type = parseDeclaratorSuffix(type); 513 // Type VariableName DeclaratorSuffix
514 ident = requireIdentifier(MSG.ExpectedVariableName);
515 type = parseDeclaratorSuffix(type);
516 }
514 } 517 }
515 518
516 // It's a variable declaration. 519 // It's a variable declaration.
517 Identifier*[] idents = [ident]; 520 Identifier*[] idents = [ident];
518 Expression[] values; 521 Expression[] values;
3754 if (optionalParamList) 3757 if (optionalParamList)
3755 params = token.type == T.LParen ? parseParameterList() : null; 3758 params = token.type == T.LParen ? parseParameterList() : null;
3756 else 3759 else
3757 params = parseParameterList(); 3760 params = parseParameterList();
3758 3761
3759 type = set(new CFuncPointerType(type, params), begin); 3762 type = new CFuncPointerType(type, params);
3760 return type; 3763 return set(type, begin);
3761 } 3764 }
3762 3765
3763 Type parseDeclarator(ref Identifier* ident, bool identOptional = false) 3766 Type parseDeclarator(ref Identifier* ident, bool identOptional = false)
3764 { 3767 {
3765 auto t = parseType(); 3768 auto t = parseType();