We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have something like:
#include <iostream> namespace { enum MyEnum { A,B }; } int main(){ std::cout << "hello" << std::endl; }
Then got:
In [8]: header = CppHeaderParser.CppHeader("main.cpp") --------------------------------------------------------------------------- CppParseError Traceback (most recent call last) File ~/.edm/envs/pmapp/lib/python3.8/site-packages/CppHeaderParser/CppHeaderParser.py:2975, in CppHeader.__init__(self, headerFileName, argType, encoding, preprocessed, **kwargs) 2974 if self.nameStack: -> 2975 self._evaluate_stack() 2976 if self.stack and self.stack[0] == "class": File ~/.edm/envs/pmapp/lib/python3.8/site-packages/CppHeaderParser/CppHeaderParser.py:3427, in CppHeader._evaluate_stack(self, token) 3426 debug_print("trace") -> 3427 self._parse_enum() 3428 self.stack = [] File ~/.edm/envs/pmapp/lib/python3.8/site-packages/CppHeaderParser/CppHeaderParser.py:3593, in CppHeader._parse_enum(self) 3592 if tok.value != "enum": -> 3593 raise self._parse_error((tok,), "enum") 3595 location = tok.location CppParseError: unexpected 'namespace', expected 'enum' The above exception was the direct cause of the following exception: CppParseError Traceback (most recent call last) Input In [8], in <cell line: 1>() ----> 1 header = CppHeaderParser.CppHeader("main.cpp") File ~/.edm/envs/pmapp/lib/python3.8/site-packages/CppHeaderParser/CppHeaderParser.py:3115, in CppHeader.__init__(self, headerFileName, argType, encoding, preprocessed, **kwargs) 3108 else: 3109 msg = "Error parsing %s%s\nError around: %s" % ( 3110 self.headerFileName, 3111 context, 3112 " ".join(self.nameStack), 3113 ) -> 3115 raise_exc( 3116 CppParseError(msg), 3117 e, 3118 ) 3120 self.finalize() 3121 global parseHistory File <string>:1, in raise_exc(e, src_e) CppParseError: Not able to parse main.cpp on line 3 evaluating 'namespace': unexpected 'namespace', expected 'enum' Error around: enum MyEnum
MacOS
No response
The text was updated successfully, but these errors were encountered:
cxxheaderparser can handle that (see https://robotpy.github.io/cxxheaderparser/ for a live demo you can paste that into).
I'm happy to accept PRs to fix this, however.
Sorry, something went wrong.
I was not aware of cxxheaderparser repo. I would switch to it once pip distribution becomes available
I wish I could but unfortunately, I do not have currently the bandwidth for it.
No branches or pull requests
Problem description
I have something like:
Then got:
Operating System
MacOS
Installed Python Packages
No response
Reproducible example code
No response
The text was updated successfully, but these errors were encountered: