robotpy / robotpy-cppheaderparser

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

Another regression in 4.0.0 #43

Closed tpaviot closed 4 years ago

tpaviot commented 4 years ago

Following example fails using 4.0.0 and newer (but not with 3.3.0 and older):

import CppHeaderParser

h = """
typedef C A;

class B
{
public:
   A aMethod();
}
"""
CppHeaderParser.CppHeader(h, "string")

Following exception is raised:

Traceback (most recent call last):
  File "ess.py", line 12, in <module>
    CppHeaderParser.CppHeader(h, "string")
  File "/home/thomas/miniconda3/envs/bindgen/lib/python3.7/site-packages/CppHeaderParser/CppHeaderParser.py", line 2981, in __init__
    self.finalize()
  File "/home/thomas/miniconda3/envs/bindgen/lib/python3.7/site-packages/CppHeaderParser/CppHeaderParser.py", line 1936, in finalize
    self.resolve_type(meth["rtnType"], rtnType)
  File "/home/thomas/miniconda3/envs/bindgen/lib/python3.7/site-packages/CppHeaderParser/CppHeaderParser.py", line 1551, in resolve_type
    result["typedefs"] += 1
KeyError: 'typedefs'
virtuald commented 4 years ago

https://github.com/robotpy/robotpy-cppheaderparser/pull/44