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
Hi,
given this simple test file:
$ cat kernel.cl void A() {}
The output of parse_file() is different when using the OpenCLCparser vs the pycparser default:
parse_file()
>>> parse_file("kernel.cl", use_cpp=True).children() (('ext[0]', <pycparser.c_ast.FuncDef at 0x7f986ea2e2c8>),) >>> parse_file("kernel.cl", use_cpp=True, parser=OpenCLCParser()).children() (('ext[0]', [<pycparserext.ext_c_parser.PreprocessorLine at 0x7f986ea31240>]), ('ext[1]', [<pycparserext.ext_c_parser.PreprocessorLine at 0x7f986ea314e0>]), ('ext[2]', [<pycparserext.ext_c_parser.PreprocessorLine at 0x7f986ea271d0>]), ('ext[3]', [<pycparserext.ext_c_parser.PreprocessorLine at 0x7f986eacc898>]), ('ext[4]', [<pycparserext.ext_c_parser.PreprocessorLine at 0x7f986ea31470>]), ('ext[5]', [<pycparserext.ext_c_parser.PreprocessorLine at 0x7f986ea31128>]), ('ext[6]', <pycparser.c_ast.FuncDef at 0x7f986ed6b908>))
This breaks the behaviour of the show() method:
show()
>>> parse_file("kernel.cl", use_cpp=True, parser=OpenCLCParser()).show() Traceback (most recent call last) ... AttributeError: 'list' object has no attribute 'show'
What is the meaning of the PreprocessorLine objects? Is there a way I can disable their creation, or have I misunderstood the API?
PreprocessorLine
$ pip freeze | grep pycp pycparser==2.17 pycparserext==2016.2
The text was updated successfully, but these errors were encountered:
By the way, this is the workaround I'm currently using. Stripping out the PreprocessorLines and constructing a new FileAST. It seems to work.
Sorry, something went wrong.
No branches or pull requests
Hi,
given this simple test file:
$ cat kernel.cl void A() {}
The output of
parse_file()
is different when using the OpenCLCparser vs the pycparser default:This breaks the behaviour of the
show()
method:What is the meaning of the
PreprocessorLine
objects? Is there a way I can disable their creation, or have I misunderstood the API?$ pip freeze | grep pycp pycparser==2.17 pycparserext==2016.2
The text was updated successfully, but these errors were encountered: