terryyin / lizard

A simple code complexity analyser without caring about the C/C++ header files or Java imports, supports most of the popular languages.
Other
1.85k stars 250 forks source link

Add tests for failing constructor C++11 init list #65

Closed rakhimov closed 9 years ago

rakhimov commented 9 years ago

Tests are examples for issue #64. If a member variable or base class is initialized with an initializer list or uniform initialization within the initialization list, the constructor is parsed as multiple function definition.

terryyin commented 9 years ago

I've merged your tests and fixed them.

This time with a bit different approach. Instead of adding another state, I added a OneInitializerState class as a 'Command Pattern'. I think I'm going to gradually refactor the code to use State classes instead of state method. It's easier to remove duplicated functionalities, have nested structure, and keep a local state.