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

Fail to parse a single enum #58

Open
wtdcode opened this issue Oct 29, 2021 · 1 comment
Open

Fail to parse a single enum #58

wtdcode opened this issue Oct 29, 2021 · 1 comment

Comments

@wtdcode
Copy link

wtdcode commented Oct 29, 2021

C file:

typedef enum Test {
    A1L2,

    A = A1L2,

} Test;

Script:

from pyclibrary import CParser
print(CParser(["/tmp/test.h"]).defs)

Get

{'types': {'Test': Type('enum Test A1L2 A A1L2')}, 'variables': {}, 'fnmacros': {}, 'macros': {}, 'structs': {}, 'unions': {}, 'enums': {}, 'functions': {}, 'values': {'A1L2': 0, 'A': None}}
@wtdcode
Copy link
Author

wtdcode commented Oct 29, 2021

When evaluating the value, the 1L in A1L2 is treated as an integer literal and thus rstripped.

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