Commit ad322e9b authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Generate AST nodes for the bit fields.

parent d8b6fb22
...@@ -2262,7 +2262,7 @@ bool Parser::parseInitDeclarator(DeclaratorAST *&node, ...@@ -2262,7 +2262,7 @@ bool Parser::parseInitDeclarator(DeclaratorAST *&node,
if (acceptStructDeclarator && LA() == T_COLON) { if (acceptStructDeclarator && LA() == T_COLON) {
// anonymous bit-field declaration. // anonymous bit-field declaration.
// ### TODO create the AST
} else if (! parseDeclarator(node, /*stopAtCppInitializer = */ ! acceptStructDeclarator)) { } else if (! parseDeclarator(node, /*stopAtCppInitializer = */ ! acceptStructDeclarator)) {
return false; return false;
} }
...@@ -2289,7 +2289,9 @@ bool Parser::parseInitDeclarator(DeclaratorAST *&node, ...@@ -2289,7 +2289,9 @@ bool Parser::parseInitDeclarator(DeclaratorAST *&node,
if (parseConstantExpression(expression) && (LA() == T_COMMA || if (parseConstantExpression(expression) && (LA() == T_COMMA ||
LA() == T_SEMICOLON)) { LA() == T_SEMICOLON)) {
// recognized a bitfielddeclarator. // recognized a bitfielddeclarator.
// ### TODO create the AST if (! node)
node = new (_pool) DeclaratorAST;
node->initializer = expression;
return true; return true;
} }
rewind(colon_token); rewind(colon_token);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment