From 4ca6c51c7fb21ed0d2e56ae3487f78f263f33f01 Mon Sep 17 00:00:00 2001 From: Flex Ferrum Date: Sun, 19 Feb 2012 14:35:41 +0400 Subject: C++: Lambda formatting issues. Fix code formatting in cases when '{' and '}' appear within expression context (ex. lambda expression, initializer lists). Change-Id: I42b28170a8d6d5fd08a9a1a8d8e7698219c18966 Reviewed-by: Erik Verbruggen --- src/plugins/cpptools/cppcodeformatter.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/plugins/cpptools/cppcodeformatter.h') diff --git a/src/plugins/cpptools/cppcodeformatter.h b/src/plugins/cpptools/cppcodeformatter.h index 8dab0dbc81..a7da67f57c 100644 --- a/src/plugins/cpptools/cppcodeformatter.h +++ b/src/plugins/cpptools/cppcodeformatter.h @@ -177,7 +177,16 @@ public: // must be public to make Q_GADGET introspection work assign_open, // after an assignment token expression, // after a '=' in a declaration_start once we're sure it's not '= {' - assign_open_or_initializer // after a '=' in a declaration start + assign_open_or_initializer, // after a '=' in a declaration start + + lambda_instroducer_or_subscribtion, // just after '[' or in cases '[]' and '[id]' when we're not sure in the exact kind of expression + lambda_declarator_expected, // just after ']' in lambda_introducer_or_subscribtion + lambda_declarator_or_expression, // just after '](' when previous state is 'lambda_instroducer_or_subscribtion' + lambda_statement_expected, + lambda_instroducer, // when '=', '&' or ',' occurred within '[]' + lambda_declarator, // just after ']' when previous state is lambda_introducer + lambda_statement // just after '{' when previous state is lambda_declarator or lambda_declarator_or_expression + }; Q_ENUMS(StateType) -- cgit v1.2.1