Skip to content
New issue

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

headercvt should support independently-tagged struct definition #242

Open
ghost opened this issue Sep 13, 2019 · 2 comments
Open

headercvt should support independently-tagged struct definition #242

ghost opened this issue Sep 13, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Sep 13, 2019

@util.with_temp_wd
def test_headercvt_typedef_to_discretely_tagged_struct(self, wd):
util.kick_headercvt_and_get_results(wd, \"""
struct clpy_struct_tag{
int member;
};
typedef struct clpy_struct_tag clpy_struct_t;
\""")
self.assertTrue(util.compile_with(
wd, "cdef clpy_struct_t foo\nfoo.member = 0"))
# TODO(nsakabe-fixstars):

@ghost ghost self-assigned this Sep 13, 2019
@ghost
Copy link
Author

ghost commented Oct 2, 2019

@vorj said (Sep 13th at 5:45:12 PM):

これちゃんと対応しようとするとultimaと同じようにAST相当を別途内部で保持しておいて、typedefのマップも持って、最後に一気に出力するようなコードに落ち着きそう

構造体定義よりtypedefが先行する可能性もある

@vorj
Copy link

vorj commented Oct 2, 2019

In actually, ultima doesn't carry any ASTs around, but she has some mechanism of delayed output for supporting constructor. In following to this method, headercvt should hold two additional data, class body as string (like int member) and the map of typedef (like clpy_struct_tag -> clpy_struct_t).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant