cppclean icon indicating copy to clipboard operation
cppclean copied to clipboard

parsing error: (Token(u'::', xxx, yyy), [], [Token(u'B', zzz, bbb)])

Open TomerJLevy opened this issue 6 years ago • 1 comments

Hi,

If I put the namespace as a Macro instead of 'using' or any other C++ way, it compiles but 'cppclean' fails to parse the tokens.

Here is a way to reproduce it:

#define NS_B(b) A::b

namespace A{
  namespace B{
    class C;
  }
}

class C {
  NS_B(B)::C* c;
};

In my opinion 'cppclean' should handle that situation. Just as C++ persist to backward compatibility to C language.

TomerJLevy avatar Sep 20 '19 07:09 TomerJLevy

I have a large project (I can not share it) and I found a file where cppclean stops with an exception:

../cppclean/cppclean cppclean-error.cpp cppclean-error.cpp: parsing error: unexpected token: Token(u'return', 128, 134)

I deleted as much code as possible until the error disappeared, this is the result: cppclean.zip

abrock avatar Jan 30 '20 12:01 abrock