summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus/Parser.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2010-03-23 14:10:05 +0100
committerRoberto Raggi <roberto.raggi@nokia.com>2010-03-23 14:13:22 +0100
commit87d28e1814ce894c9af458ed3e10474536a1624d (patch)
tree7f9dcef92c02bf5e57be9674232df099db4fd50d /src/shared/cplusplus/Parser.cpp
parenteebf498aaef5551b1863d61ffb5f46507093339b (diff)
downloadqt-creator-87d28e1814ce894c9af458ed3e10474536a1624d.tar.gz
Recognize C++0x template arguments.
Diffstat (limited to 'src/shared/cplusplus/Parser.cpp')
-rw-r--r--src/shared/cplusplus/Parser.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp
index e9fac60fb3..0b7a2cd2ab 100644
--- a/src/shared/cplusplus/Parser.cpp
+++ b/src/shared/cplusplus/Parser.cpp
@@ -835,6 +835,10 @@ bool Parser::parseTemplateArgumentList(TemplateArgumentListAST *&node)
*template_argument_ptr = new (_pool) TemplateArgumentListAST;
(*template_argument_ptr)->value = template_argument;
template_argument_ptr = &(*template_argument_ptr)->next;
+
+ if (_cxx0xEnabled && LA() == T_DOT_DOT_DOT)
+ consumeToken(); // ### store this token in the AST
+
while (LA() == T_COMMA) {
consumeToken(); // consume T_COMMA
@@ -842,6 +846,9 @@ bool Parser::parseTemplateArgumentList(TemplateArgumentListAST *&node)
*template_argument_ptr = new (_pool) TemplateArgumentListAST;
(*template_argument_ptr)->value = template_argument;
template_argument_ptr = &(*template_argument_ptr)->next;
+
+ if (_cxx0xEnabled && LA() == T_DOT_DOT_DOT)
+ consumeToken(); // ### store this token in the AST
}
}
@@ -1115,8 +1122,15 @@ bool Parser::parseTemplateArgument(ExpressionAST *&node)
{
DEBUG_THIS_RULE();
unsigned start = cursor();
- if (parseTypeId(node) && (LA() == T_COMMA || LA() == T_GREATER))
- return true;
+ if (parseTypeId(node)) {
+ int index = 1;
+
+ if (_cxx0xEnabled && LA() == T_DOT_DOT_DOT)
+ index = 2;
+
+ if (LA(index) == T_COMMA || LA(index) == T_GREATER)
+ return true;
+ }
rewind(start);
bool previousTemplateArguments = switchTemplateArguments(true);