← 输入框|github.com|刷新
Skip to content

Regression in 4.0.0 #41

Closed
Closed

Description

@tpaviot

The following code works on 3.3.0 release but fails from 4.0.0 and later:

import CppHeaderParser

h = """
template <class SomeType> class A {
 public:
  typedef B <SomeType> C;
  
  A();

 protected:
  C aCInstance;
};

"""
a = CppHeaderParser.CppHeader(h, "string")
print(a)

The error message is the following:

Traceback (most recent call last):
  File "ess.py", line 15, in <module>
    a = 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 1918, in finalize
    self.finalize_vars()
  File "/home/thomas/miniconda3/envs/bindgen/lib/python3.7/site-packages/CppHeaderParser/CppHeaderParser.py", line 1664, in finalize_vars
    var["raw_type"] = var["method"]["path"] + "::" + tag
KeyError: 'method'

Note that the issue comes from the last line C aCInstance;. If type is changed to something else but C, string is parse correctly.

ping @rainman110

Activity

  1. virtuald commented on Mar 4, 2020

    @virtuald
    Member

    Just out of curiosity, how many more of these do you have? :)

  2. tpaviot commented on Mar 4, 2020

    @tpaviot
    Author

    I still have to pass 4.0.0, 5.0.0, 5.0.1 and 5.0.2 steps, wait and see ;)

  3. tpaviot commented on Mar 4, 2020

    @tpaviot
    Author

    @virtuald FYI it's a work related to https://github.com/tpaviot/pythonocc-generator and https://github.com/tpaviot/pythonocc-core projects, python bindings for the opencascade c++ library https://dev.opencascade.org/

  4. changed the title [-]Regression in 4.4.0[/-] [+]Regression in 4.0.0[/+] on Mar 4, 2020
  5. added a commit that references this issue on Mar 4, 2020
    f19ca93
  6. virtuald commented on Mar 4, 2020

    @virtuald
    Member

    See #42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions