From adb90dc65f2f211675af5be27d2a7efdf96c6f44 Mon Sep 17 00:00:00 2001 From: amitkummer <49096391+amitkummer@users.noreply.github.com> Date: Thu, 18 Aug 2022 15:15:40 +0200 Subject: CFamilyLexer: Fix matching of function parameters (#2210) This fixes an issue where in code like this: ``` int foo(float bar) // hello() {} ``` The lexer would match `(float bar) // hello()` as the parameters of the function `foo`, instead of just `(float bar)`. In addition, a similar test case to what was originally reported in #2208 is added. --- tests/examplefiles/cpp/functions.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'tests/examplefiles/cpp/functions.cpp') diff --git a/tests/examplefiles/cpp/functions.cpp b/tests/examplefiles/cpp/functions.cpp index ef359fe0..25b232b9 100644 --- a/tests/examplefiles/cpp/functions.cpp +++ b/tests/examplefiles/cpp/functions.cpp @@ -87,4 +87,20 @@ class raz { // Make sure these are not functions: else if(flag && func_call()) {} new T(); -const operator int() const {} // so int is lexed as type and not function.name \ No newline at end of file +const operator int() const {} // so int is lexed as type and not function.name + +class foo bar : public raz +{ + Q_OBJECT + /// \cond INCLUDE_QPROPERTIES + Q_PROPERTY(arg1 arg2) + /// \endcond + +public: + /*! + Lorem ipsum core vanditi. + */ + enum duck { dog, // Comment. + cat // Comment (see \ref replot). + }; +}; -- cgit v1.2.1