robotpy / robotpy-cppheaderparser

DEPRECATED: use cxxheaderparser instead
Other
123 stars 39 forks source link

Fixing type reference to self #64

Closed wflohry closed 3 years ago

wflohry commented 3 years ago

There seems to be a bug for some functions that reference the type itself. For instance, running the parser against the struct A shown below will result in a "Circular reference detected" during the JSON encoding step:

struct A{
        bool operator==(const A& other) const {
                return true;
        }
};

This PR solves this issue by removing any circular references in the dictionary before passing to the JSON.

virtuald commented 3 years ago

Thanks for the fix!

FWIW, I wrote a different C++ parser in python (https://github.com/robotpy/cxxheaderparser), and I'd encourage you to try it out. Once I finish migrating my tools over to it I'm going to deprecate this repo. Would love any feedback!

wflohry commented 3 years ago

Thanks! Will check it out.