Generate AST nodes for the bit fields.

This commit is contained in:
Roberto Raggi
2010-08-12 15:14:25 +02:00
parent d8b6fb2282
commit ad322e9b17

View File

@@ -2262,7 +2262,7 @@ bool Parser::parseInitDeclarator(DeclaratorAST *&node,
if (acceptStructDeclarator && LA() == T_COLON) {
// anonymous bit-field declaration.
// ### TODO create the AST
} else if (! parseDeclarator(node, /*stopAtCppInitializer = */ ! acceptStructDeclarator)) {
return false;
}
@@ -2289,7 +2289,9 @@ bool Parser::parseInitDeclarator(DeclaratorAST *&node,
if (parseConstantExpression(expression) && (LA() == T_COMMA ||
LA() == T_SEMICOLON)) {
// recognized a bitfielddeclarator.
// ### TODO create the AST
if (! node)
node = new (_pool) DeclaratorAST;
node->initializer = expression;
return true;
}
rewind(colon_token);